1700
How do I layout expandable columns

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:ColumnAutoResize := .F.
		oG2antt:DrawGridLines := -1/*exAllLines*/
		oG2antt:SetProperty("BackColorLevelHeader",oG2antt:BackColor())
		oColumns := oG2antt:Columns()
			oColumn := oColumns:Add("C0")
				oColumn:ExpandColumns := "1,2"
				oColumn:DisplayExpandButton := .T.
			oColumns:Add("C1")
			oColumns:Add("C2")
			oColumns:Add("C3")
			oColumn1 := oColumns:Add("C4")
				oColumn1:ExpandColumns := "5,6"
				oColumn1:DisplayExpandButton := .T.
			oColumns:Add("C5")
			oColumn2 := oColumns:Add("C6")
				oColumn2:ExpandColumns := "6,7"
				oColumn2:DisplayExpandButton := .T.
			oColumns:Add("C7")
		oG2antt:EndUpdate()
		oG2antt:Columns:Item("C4"):Expanded := .F.

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1699
Is it possible to display automatically the start/end margins of the bars

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,64)
			oBar := oChart:Bars:Item("Task")
				oBar:SetProperty("Def",3/*exBarCaption*/,"<%=%1%>")
				oBar:SetProperty("Def",4/*exBarHAlignCaption*/,16)
				oBar:SetProperty("Def",44/*exBarExtraCaption*/,"<%=%2%>")
				oBar:SetProperty("Def",45/*exBarExtraCaptionHAlign*/,18)
			oChart:ScrollTo(oChart:FirstVisibleDate(),1)
		oG2antt:Columns():Add("Task")
		oG2antt:Columns():Add("ToolTip"):Visible := .F.
		oItems := oG2antt:Items()
			h := oItems:AddItem("Item 1")
			oItems:SetProperty("CellValue",h,1,"bar <b>a")
			oItems:AddBar(h,"Task","12/29/2000","01/05/2001")
			h := oItems:AddItem("Item 2")
			oItems:SetProperty("CellValue",h,1,"bar <b>b")
			oItems:AddBar(h,"Task","12/30/2000","01/06/2001")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1698
Is it possible to assign the bar's caption from a hidden column

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,64)
			oBar := oChart:Bars:Item("Task")
				oBar:SetProperty("Def",3/*exBarCaption*/,"<%=%C1%>")
				oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18)
		oG2antt:Columns():Add("Task")
		oG2antt:Columns():Add("ToolTip"):Visible := .F.
		oItems := oG2antt:Items()
			h := oItems:AddItem("Item 1")
			oItems:SetProperty("CellValue",h,1,"bar <b>a")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001")
			h := oItems:AddItem("Item 2")
			oItems:SetProperty("CellValue",h,1,"bar <b>b")
			oItems:AddBar(h,"Task","01/03/2001","01/06/2001")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1697
Is it possible to assign the bar's tooltip from a hidden column

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,64)
			oChart:Bars:Item("Task"):SetProperty("Def",6/*exBarToolTip*/,"<%=%C1%>")
		oG2antt:Columns():Add("Task")
		oG2antt:Columns():Add("ToolTip"):Visible := .F.
		oItems := oG2antt:Items()
			h := oItems:AddItem("Item 1")
			oItems:SetProperty("CellValue",h,1,"This is a bit of text that's shown when the cursor hovers the bar on item 1.")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001")
			h := oItems:AddItem("Item 2")
			oItems:SetProperty("CellValue",h,1,"This is a bit of text that's shown when the cursor hovers the bar on item 2.")
			oItems:AddBar(h,"Task","01/03/2001","01/06/2001")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1696
I am using exBarFrameColor, but no black frame is shown. What could be wrong (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
		oG2antt:Columns():Add("Task")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Default")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001")
			oItems:SetProperty("ItemBar",h,"",51/*exBarFrameColor*/,65536)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1695
I am using exBarFrameColor, but no black frame is shown. What could be wrong (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
			oChart:Bars:Item("Task"):SetProperty("Def",51/*exBarFrameColor*/,65536)
		oG2antt:Columns():Add("Task")
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Default"),"Task","01/02/2001","01/05/2001")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1694
What I need is bars that have a solid color, but with a black frame. How can we do that

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DefaultItemHeight := 22
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:LevelCount := 2
			oChart:SetProperty("PaneWidth",.F.,0)
		oBar := oG2antt:Chart():Bars():Add("Frame")
			oBar:Pattern := 1/*exPatternSolid*/
			oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			oBar:SetProperty("Def",51/*exBarFrameColor*/,65536)
			oBar:SetProperty("Def",3/*exBarCaption*/,"<font ;6><%=%C0%>")
			oBar:SetProperty("Def",4/*exBarHAlignCaption*/,18)
			oBar:Height := 15
		oG2antt:Columns():Add("Frames")
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Default"),"Frame","01/02/2001","01/07/2001")
			h := oItems:AddItem("Inside Color")
			oItems:AddBar(h,"Frame","01/02/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,255)
			h := oItems:AddItem("Border Color")
			oItems:AddBar(h,"Frame","01/02/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",51/*exBarFrameColor*/,33023)
			h := oItems:AddItem("Inside/Border Color")
			oItems:AddBar(h,"Frame","01/02/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,16711680)
			oItems:SetProperty("ItemBar",h,"",51/*exBarFrameColor*/,33023)
			h := oItems:AddItem("Thick-Border")
			oItems:AddBar(h,"Frame","01/02/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",42/*exBarPattern*/,4097)
			h := oItems:AddItem("Thick-Border + Pattern")
			oItems:AddBar(h,"Frame","01/02/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",42/*exBarPattern*/,4098)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1693
How can we drag bars from one item to the other

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DefaultItemHeight := 22
		oG2antt:DrawGridLines := -1/*exAllLines*/
		oG2antt:Columns():Add("Members"):SetProperty("Def",17/*exCellValueFormat*/,1)
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "09/20/2006"
			oChart:AllowLinkBars := .F.
			oChart:AllowCreateBar := 0/*exNoCreateBar*/
			oChart:AllowSelectObjects := 0/*exNoSelectObjects*/
			oChart:LevelCount := 2
			oChart:SetProperty("PaneWidth",.F.,96)
			oChart:DrawGridLines := -1/*exAllLines*/
			oBar := oChart:Bars:Item("Task")
				oBar:OverlaidType := 4611/*exOverlaidBarsIncludeCaption+exOverlaidBarsStackAutoArrange+exOverlaidBarsStack*/
				oBar:Height := 18
				oBar:Pattern := 1/*exPatternSolid*/
				oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 0,128,255 } )  , .F. ))
		oItems := oG2antt:Items()
			h := oItems:AddItem("Member <b>1</b>")
			oItems:AddBar(h,"Task","09/21/2006","09/23/2006","T102","<font ;6><fgcolor FFFFFF>Task <b>102</b>")
			oItems:SetProperty("ItemBar",h,"T102",28/*exBarCanMoveToAnother*/,.T.)
			h := oItems:AddItem("Member <b>2</b>")
			h := oItems:AddItem("Member <b>3</b>")
			h := oItems:AddItem("Member <b>4</b>")
			oItems:AddBar(h,"Task","09/21/2006","09/23/2006","T103","<font ;6><fgcolor FFFFFF>Task <b>103</b>")
			oItems:SetProperty("ItemBar",h,"T103",28/*exBarCanMoveToAnother*/,.T.)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1692
How can I use the exBarBackgroundExt option of the Items.ItemBar property

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DefaultItemHeight := 26
		oChart := oG2antt:Chart()
			oChart:NonworkingDays := 0
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
			oChart:Bars:Item("Task"):Height := 22
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Border-Top")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"top[3,back=RGB(0,0,0)]")
			h := oItems:AddItem("Border-Bottom")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"bottom[3,back=RGB(255,0,0)]")
			h := oItems:AddItem("Border-Left")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"left[6,back=RGB(0,255,0)]")
			h := oItems:AddItem("Border-Right")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"right[6,back=RGB(0,0,255)]")
			h := oItems:AddItem("Border-All")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"top[3,back=RGB(0,0,0)],right[3,back=RGB(0,0,255)],bottom[3,back=RGB(255,0,0)],left[3,back=RGB(0,255,0)],client")
			h := oItems:AddItem("Middle")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"none[(25%,25%,50%,50%),back=RGB(255,0,0)]")
			h := oItems:AddItem("Horizontal")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"none[(0,50%-2,100%,4),back=RGB(255,0,0)]")
			h := oItems:AddItem("Vertical")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"none[(50%-2,0,4,100%),back=RGB(255,0,0)]")
			h := oItems:AddItem("Mixt")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]")
			h := oItems:AddItem("Misc")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"bottom[50%,pattern=10,frame]")
			h := oItems:AddItem("Complex")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
			oItems:SetProperty("ItemBar",h,"",53/*exBarBackgroundExt*/,"left[10%](top[90%,back=RGB(0,0,0)]),top[30%,back=RGB(254,217,102)],client[back=RGB(91,156,212)]")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1691
Does the title of the cell's tooltip supports HTML format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
		oColumn := oG2antt:Columns():Add("")
			oColumn:Caption := ""
			oColumn:HTMLCaption := "Column"
		oItems := oG2antt:Items()
			oItems:SetProperty("CellToolTip",oItems:AddItem("tooltip w/h different title"),0,"<c><b><fgcolor=FF0000>Title</fgcolor></b><br>This is bit of text that's shown when the user hovers the cell. This shows the title centered with a different color.")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1690
How do I specify a different title for the cell's tooltip

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
		oColumn := oG2antt:Columns():Add("")
			oColumn:Caption := "This is the title"
			oColumn:HTMLCaption := "Column"
		oItems := oG2antt:Items()
			oItems:SetProperty("CellToolTip",oItems:AddItem("tooltip w/h different title"),0,"This is bit of text that's shown when the user hovers the cell.")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1689
The cell's tooltip displays the column's caption in its title. How can I get ride of that

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
		oColumns := oG2antt:Columns()
			oColumns:Add("C1")
			oColumns:Add("C2")
		oItems := oG2antt:Items()
			h := oItems:AddItem("tooltip w/h caption")
			oItems:SetProperty("CellToolTip",h,0,"This is bit of text that's shown when the user hovers the cell. This shows the column's caption in the title.")
			oItems:SetProperty("CellValue",h,1,"tooltip no caption")
			oItems:SetProperty("CellToolTip",h,1,"This is bit of text that's shown when the user hovers the cell. This shows no column's caption in the title.")
		oColumn := oG2antt:Columns():Item("C2")
			oColumn:HTMLCaption := oColumn:Caption()
			oColumn:Caption := ""
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1688
How can I programmatically show the column's filter

PROCEDURE OnRClick(oG2antt)
	/*Columns(c).ShowFilter("-1,-1,128,128")*/
	LOCAL i
	i := oG2antt:ItemFromPoint(-1,-1,c,hit)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:RClick := {|| OnRClick(oG2antt)} /*Fired when right mouse button is clicked*/

		oG2antt:BeginUpdate()
		oG2antt:ShowFocusRect := .F.
		oColumn := oG2antt:Columns():Add("Items ")
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
		oItems := oG2antt:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")
			oItems:AddItem("Item 3")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1687
I want to be able to click on one of the headers, and sort by other column. How can I do that (method 2)

PROCEDURE OnColumnClick(oG2antt,Column)
	/*Column.SortOrder = 1*/
	oG2antt:SortOnClick := -1/*exDefaultSort*/
	oG2antt:Columns:Item("Sort"):SortOrder := 1/*SortAscending*/
	oG2antt:SortOnClick := 1/*exUserSort*/
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:ColumnClick := {|Column| OnColumnClick(oG2antt,Column)} /*Fired after the user clicks on column's header.*/

		oG2antt:BeginUpdate()
		oG2antt:SortOnClick := 1/*exUserSort*/
		oG2antt:Columns():Add("Items")
		oG2antt:Columns():Add("Sort"):Visible := .F.
		oItems := oG2antt:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Item 1 (3)"),1,3)
			oItems:SetProperty("CellValue",oItems:AddItem("Item 2 (1)"),1,1)
			oItems:SetProperty("CellValue",oItems:AddItem("Item 3 (2)"),1,2)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1686
I want to be able to click on one of the headers, and sort by other column. How can I do that (method 1)

PROCEDURE OnColumnClick(oG2antt,Column)
	/*Column.SortOrder = 1*/
	oG2antt:Items():SortChildren(0,"Sort",.T.)
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:ColumnClick := {|Column| OnColumnClick(oG2antt,Column)} /*Fired after the user clicks on column's header.*/

		oG2antt:BeginUpdate()
		oG2antt:SortOnClick := 1/*exUserSort*/
		oG2antt:Columns():Add("Items")
		oG2antt:Columns():Add("Sort"):Visible := .F.
		oItems := oG2antt:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Item 1 (3)"),1,3)
			oItems:SetProperty("CellValue",oItems:AddItem("Item 2 (1)"),1,1)
			oItems:SetProperty("CellValue",oItems:AddItem("Item 3 (2)"),1,2)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1685
How do I get information about control's events
PROCEDURE OnEvent(oG2antt,EventID)
	DevOut( Transform(oG2antt:ExecuteTemplate("EventParam(-2)"),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:Event := {|EventID| OnEvent(oG2antt,EventID)} /*Notifies the application once the control fires an event.*/

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,48)
			oChart:AllowLinkBars := .F.
			oChart:Bars:Item("Task"):OverlaidType := 257/*exOverlaidBarsTransparent+exOverlaidBarsOffset*/
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Item 1")
			oItems:SetProperty("EnableItem",h,.F.)
			oItems:SetProperty("ItemData",h,-1)
			h := oItems:AddItem("Item 2")
			oItems:SetProperty("ItemData",h,0)
			oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B")
			oItems:SetProperty("ItemBar",h,"B",28/*exBarCanMoveToAnother*/,.T.)
			oItems:SetProperty("ItemData",oItems:AddItem("Item 3"),0)
			h := oItems:AddItem("Item 4")
			oItems:SetProperty("EnableItem",h,.F.)
			oItems:SetProperty("ItemData",h,-1)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1684
How can I sort by two-columns, one by date and one by time

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:SingleSort := .F.
		oColumns := oG2antt:Columns()
			oColumns:Add("Index"):FormatColumn := "1 index ``"
			oColumns:Add("Date"):SortType := 2/*SortDate*/
			oColumn := oColumns:Add("Time")
				oColumn:SortType := 4/*SortTime*/
				oColumn:FormatColumn := "time(value)"
		oItems := oG2antt:Items()
			h := oItems:AddItem(0)
			oItems:SetProperty("CellValue",h,1,"01/01/2001")
			oItems:SetProperty("CellValue",h,2,"01/01/2001 10:00:00")
			h := oItems:AddItem(0)
			oItems:SetProperty("CellValue",h,1,"12/31/2000")
			oItems:SetProperty("CellValue",h,2,"01/01/2001 10:00:00")
			h := oItems:AddItem(0)
			oItems:SetProperty("CellValue",h,1,"01/01/2001")
			oItems:SetProperty("CellValue",h,2,"01/01/2001 06:00:00")
			h := oItems:AddItem(0)
			oItems:SetProperty("CellValue",h,1,"12/31/2000")
			oItems:SetProperty("CellValue",h,2,"01/01/2001 08:00:00")
			h := oItems:AddItem(0)
			oItems:SetProperty("CellValue",h,1,"01/01/2001")
			oItems:SetProperty("CellValue",h,2,"01/01/2001 08:00:00")
			h := oItems:AddItem(0)
			oItems:SetProperty("CellValue",h,1,"12/31/2000")
			oItems:SetProperty("CellValue",h,2,"01/01/2001 06:00:00")
		oG2antt:Layout := "multiplesort=" + CHR(34) + "C1:1 C2:1" + CHR(34) + ""
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1683
I am trying to hide the non-working dates by using the AddNonworkingDate to specify custom non-working dates while NonworkingDays property is 0, but the non-working date is still shown. What can be wrong

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2008"
			oChart:SetProperty("PaneWidth",.F.,0)
			oChart:LevelCount := 2
			oChart:ShowNonworkingUnits := .F.
			oChart:ShowNonworkingDates := .F.
			oChart:NonworkingDays := 128
			oChart:AddNonworkingDate("01/07/2008")
			oChart:AddNonworkingDate("01/08/2008")
			oChart:AddNonworkingDate("01/09/2008")
			oChart:AddNonworkingDate("01/10/2008")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1682
How can I display the task's duration, in days, hours and minutes

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn,oColumn1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oColumn := oG2antt:Columns():Add("Tasks")
			oColumn:AllowSizing := .F.
			oColumn:Width := 36
		oColumn1 := oG2antt:Columns():Add("Duration")
			oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513)
			oColumn1:FormatColumn := "((1:=int(0:= (value))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')"
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,148)
			oChart:FirstVisibleDate := "04/06/2009"
			oChart:LevelCount := 2
			oChart:UnitScale := 65536/*exHour*/
			oChart:ResizeUnitScale := 1048576/*exMinute*/
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("T1"),"Task","04/06/2009 02:30:00","04/06/2009 12:35:00")
			oItems:AddBar(oItems:AddItem("T2"),"Task","04/06/2009 09:00:00","04/06/2009 10:10:00")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1681
Does your control support working half-hour/minutes/seconds

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBars
	LOCAL oChart
	LOCAL oColumn,oColumn1
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oColumn := oG2antt:Columns():Add("Tasks")
			oColumn:AllowSizing := .F.
			oColumn:Width := 36
		oColumn1 := oG2antt:Columns():Add("Working")
			oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,258)
			oColumn1:FormatColumn := "((1:=int(0:= (value))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')"
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "04/06/2009"
			oChart:SetProperty("PaneWidth",.F.,148)
			oChart:LevelCount := 2
			oChart:UnitScale := 65536/*exHour*/
			oChart:ResizeUnitScale := 1048576/*exMinute*/
			oChart:ResizeUnitCount := 15
			oChart:NonworkingHours := 15728767
			oChart:ShowNonworkingDates := .F.
			oChart:ShowNonworkingUnits := .F.
			oChart:ShowNonworkingHours := .F.
			oBars := oChart:Bars()
				oBars:Add("Task:Split"):Shortcut := "Task"
				oBars:Item("Task"):SetProperty("Def",20/*exBarKeepWorkingCount*/,.T.)
			oChart:AllowLinkBars := .F.
			oChart:UnitWidth := 26
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oItems := oG2antt:Items()
			h := oItems:AddItem("T1")
			oItems:SetProperty("ItemNonworkingUnits",h,.F.,"(weekday(value) in (1,2,3,4,5) and (timeF(value)<" + CHR(34) + "09:30" + CHR(34) + "  or timeF(value)>=" + CHR(34) + "17:30" + CHR(34) + ")) or (weekday(value) in (0,6))")
			oItems:AddBar(h,"Task","04/06/2009 10:00:00","04/06/2009 12:30:00")
			h := oItems:AddItem("T2")
			oItems:SetProperty("ItemNonworkingUnits",h,.F.,"(weekday(value) in (1,2,3,4,5) and (timeF(value)<" + CHR(34) + "08:00" + CHR(34) + "  or timeF(value)>=" + CHR(34) + "16:00" + CHR(34) + ")) or (weekday(value) in (0,6))")
			oItems:AddBar(h,"Task","04/06/2009 09:30:00","04/06/2009 10:45:00")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1680
How can I programmatically move a bar to a specified date-time
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL duration,h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,64)
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Original")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			h := oItems:AddItem("Moved")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			duration := oItems:ItemBar(h,"key",513/*exBarDuration*/)
			oItems:AddBar(h,"Task","01/05/2001","01/05/2001","key")
			oItems:SetProperty("ItemBar",h,"key",513/*exBarDuration*/,duration)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1679
How can I programmatically move a bar, with a specified ammount
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,64)
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Original")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			h := oItems:AddItem("Moved")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			oItems:SetProperty("ItemBar",h,"key",514/*exBarMove*/,3)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1678
How can I programmatically move a bar to a specified date-time (auto-adjust spans over a non-working period)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBars
	LOCAL oChart
	LOCAL oItems
	LOCAL h,workingCount

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,64)
			oBars := oChart:Bars()
				oBars:Item("Task"):SetProperty("Def",20/*exBarKeepWorkingCount*/,.T.)
				oBars:Add("Task:Split"):Shortcut := "Task"
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Original")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			h := oItems:AddItem("Moved")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			workingCount := oItems:ItemBar(h,"key",258/*exBarWorkingCount*/)
			oItems:AddBar(h,"Task","01/05/2001","01/05/2001","key")
			oItems:SetProperty("ItemBar",h,"key",258/*exBarWorkingCount*/,workingCount)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1677
How can I programmatically move a bar, with a specified ammount (auto-adjust spans over a non-working period)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBars
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,64)
			oBars := oChart:Bars()
				oBars:Item("Task"):SetProperty("Def",20/*exBarKeepWorkingCount*/,.T.)
				oBars:Add("Task:Split"):Shortcut := "Task"
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Original")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			h := oItems:AddItem("Moved")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","key")
			oItems:SetProperty("ItemBar",h,"key",514/*exBarMove*/,3)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1676
How can I show a secondary curve, line in the control's histogram

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar,oBar1
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oG2antt:AntiAliasing := .T.
		oChart := oG2antt:Chart()
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:LevelCount := 2
			oChart:SetProperty("PaneWidth",.F.,40)
			oChart:FirstVisibleDate := "06/09/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramView := 1136/*exHistogramNoGrouping+exHistogramAllItems*/
			oChart:HistogramHeight := 128
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramType := 0/*exHistOverload*/
				oBar:HistogramItems := 8
				oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
			oChart:Level(1):Label := "<font ;3><%d%>"
			oChart:UnitWidth := 9
			oBar1 := oChart:Bars:Item("Summary")
				oBar1:HistogramPattern := 1024/*exRoundCurve*/
				oBar1:SetProperty("HistogramColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
				oBar1:HistogramType := 0/*exHistOverload*/
				oBar1:HistogramItems := 8
				oBar1:HistogramBorderSize := 1
		oItems := oG2antt:Items()
			oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
			h := oItems:LockedItem(0/*exTop*/,0)
			oItems:SetProperty("ItemHeight",h,0)
			oItems:AddBar(h,"Summary","01/01/2005","12/31/2005","1")
			oItems:SetProperty("ItemBar",h,"1",21/*exBarEffort*/,"(value mod 31) array (1,1,1,2,1,2.5,3,4,5,4,3,2,1,2,2,3,4.5,4,5,6,7,6,1,2,3,1,1,1,2,3,2,2)")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/10/2005","07/16/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"weekday(value) in (0,6) ? 0.25 : 2")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/18/2005","07/21/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"weekday(value) = 1 ? 2.5 : .5")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1675
How can I add an owner-draw bar
PROCEDURE OnAfterDrawPart(oG2antt,Part,hDC,X,Y,Width,Height)
	DevOut( "AfterDrawPart" )
	DevOut( Transform(Part,"") )
	DevOut( oG2antt:Items:CellCaption(oG2antt:DrawPartItem(),0) )
	DevOut( Transform(oG2antt:DrawPartKey(),"") )
RETURN

PROCEDURE OnBeforeDrawPart(oG2antt,Part,hDC,X,Y,Width,Height,Cancel)
	Cancel := .T.
	DevOut( "BeforeDrawPart" )
	DevOut( Transform(Part,"") )
	DevOut( oG2antt:Items:CellCaption(oG2antt:DrawPartItem(),0) )
	DevOut( Transform(oG2antt:DrawPartKey(),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:AfterDrawPart := {|Part,hDC,X,Y,Width,Height| OnAfterDrawPart(oG2antt,Part,hDC,X,Y,Width,Height)} /*Occurs right after drawing the part of the control.*/
		oG2antt:BeforeDrawPart := {|Part,hDC,X,Y,Width,Height,Cancel| OnBeforeDrawPart(oG2antt,Part,hDC,X,Y,Width,Height,Cancel)} /*Occurs just before drawing a part of the control.*/

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
			oChart:LevelCount := 2
			oChart:Bars():Add("OwnerDraw")
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Draw-Item-Bar-1"),"OwnerDraw","01/02/2001","01/05/2001","K1")
			oItems:AddBar(oItems:AddItem("Draw-Item-Bar-2"),"OwnerDraw","01/06/2001","01/09/2001","K1")
			oItems:SetProperty("ItemBar",0,"<*>",257/*exBarSelected*/,.T.)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1674
Is it possible to show a status left or right to the bar (method 2, exBarFrameColor, EBN)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oAppearance
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oAppearance := oG2antt:VisualAppearance()
			oAppearance:Add(2,"gBFLBCJwBAEHhEJAAChABP0IQAAYAQGKIaBoAKBQAGaAoDDYMQyQwAAxDOKsEwsACEIrjKCRShyCYZRrGUQyAKESRAGyTJBlKKodgOLYYSrFcgSIAsEhqGASRZGUBIJDEMI4AJPIwxNIDfyNGKWI6gOQKIoSCYlU7IED0fQNGxVF6XaYqYAIRDINQlVzXcQzPYEbRxCKLKppWqIfpuSIBgI=")
			oAppearance:Add(1,"CP:2 -8 -1 0 0")
			oAppearance:Add(3,"CP:2 0 -1 0 0")
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
		oItems := oG2antt:Items()
			h := oItems:AddItem("Red-Status-Outside")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,16777471)
			h := oItems:AddItem("Blue-Status-Outside")
			oItems:AddBar(h,"Task","01/03/2001","01/06/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,33488896)
			h := oItems:AddItem("Red-Status-Inside")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,50331903)
			h := oItems:AddItem("Blue-Status-Inside")
			oItems:AddBar(h,"Task","01/03/2001","01/06/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,67043328)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1673
Is it possible to show a status left or right to the bar (method 1, exBarBackgroundExt)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
		oItems := oG2antt:Items()
			h := oItems:AddItem("Red-Left-Status-Inside")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"left[6,back=RGB(255,0,0)]")
			h := oItems:AddItem("Blue-Left-Status-Inside")
			oItems:AddBar(h,"Task","01/03/2001","01/06/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"left[6,back=RGB(0,0,255)]")
			h := oItems:AddItem("Red-Right-Status-Inside")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"right[6,back=RGB(255,0,0)]")
			h := oItems:AddItem("Blue-Right-Status-Inside")
			oItems:AddBar(h,"Task","01/03/2001","01/06/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"right[6,back=RGB(0,0,255)]")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1672
How can I use the ItemBar(exBarBackgroundExt) property for a bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DefaultItemHeight := 31
		oG2antt:DrawGridLines := -1/*exAllLines*/
		oG2antt:SetProperty("GridLineColor",AutomationTranslateColor( GraMakeRGBColor  ( { 224,224,224 } )  , .F. ))
		oG2antt:SetProperty("BackColorLevelHeader",oG2antt:BackColor())
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:Level(0):SetProperty("GridLineColor",oG2antt:GridLineColor())
			oChart:Level(1):SetProperty("GridLineColor",oG2antt:GridLineColor())
			oChart:ShowNonworkingDates := .F.
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
			oChart:Bars:Item("Task"):Height := 21
			oChart:DrawGridLines := -1/*exAllLines*/
		oItems := oG2antt:Items()
			h := oItems:AddItem("Normal")
			oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K1")
			h := oItems:AddItem("Red-Frame-Inside")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"[frame=RGB(255,0,0),framethick]")
			h := oItems:AddItem("LR-Margins")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"left[4,back=RGB(0,255,0)],right[4,back=RGB(0,0,255)]")
			h := oItems:AddItem("LR-Margins (front)")
			oItems:AddBar(h,"Task","01/02/2001","01/07/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"left[4,back=RGB(0,255,0)],right[4,back=RGB(0,0,255)]")
			oItems:SetProperty("ItemBar",h,"K1",54/*exBarBackgroundExtFlags*/,2)
			h := oItems:AddItem("LR-Margins (back)")
			oItems:AddBar(h,"Task","01/02/2001","01/08/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"left[4,back=RGB(0,255,0)],right[4,back=RGB(0,0,255)]")
			oItems:SetProperty("ItemBar",h,"K1",54/*exBarBackgroundExtFlags*/,3)
			h := oItems:AddItem("TB-Margins")
			oItems:AddBar(h,"Task","01/02/2001","01/09/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"top[4,back=RGB(255,0,0)],bottom[4,back=RGB(0,255,0)]")
			h := oItems:AddItem("TB-Margins")
			oItems:AddBar(h,"Task","01/02/2001","01/10/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"top[2,back=RGB(255,0,0)],bottom[2,back=RGB(0,255,0)]")
			oItems:SetProperty("ItemBar",h,"K1",54/*exBarBackgroundExtFlags*/,2)
			h := oItems:AddItem("Caption(back)")
			oItems:AddBar(h,"Task","01/02/2001","01/11/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"client(bottom[14,text=`<sha ;;0><font ;8>background`,align=0x11])")
			oItems:SetProperty("ItemBar",h,"K1",54/*exBarBackgroundExtFlags*/,2)
			h := oItems:AddItem("Pattern-Outside")
			oItems:AddBar(h,"Task","01/02/2001","01/12/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"bottom[10%,pattern=7,frame]")
			oItems:SetProperty("ItemBar",h,"K1",54/*exBarBackgroundExtFlags*/,2)
			h := oItems:AddItem("Pattern-Inside")
			oItems:AddBar(h,"Task","01/02/2001","01/13/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"bottom[7,pattern=3,frame]")
			h := oItems:AddItem("Pattern-Inside-Caption")
			oItems:AddBar(h,"Task","01/02/2001","01/12/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"top[4](left[4],right[4],client),bottom[4](left[4],right[4],client),left[4],right[4],client(left[75%,text=`<fgcolor FFFFFF>75%`,align=0x11,pattern=0x001,frame=RGB(255,0,0)])")
			h := oItems:AddItem("Complex(back)")
			oItems:AddBar(h,"Task","01/02/2001","01/11/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"top[30%,back=RGB(253,218,101)],client[back=RGB(91,157,210)],none[(0%,0%,10%,100%)](top[90%,back=RGB(0,0,0)])")
			oItems:SetProperty("ItemBar",h,"K1",54/*exBarBackgroundExtFlags*/,3)
			h := oItems:AddItem("Complex(inside)")
			oItems:AddBar(h,"Task","01/02/2001","01/12/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",53/*exBarBackgroundExt*/,"top[30%,back=RGB(253,218,101)],client[back=RGB(91,157,210)],none[(0%,0%,10%,100%)](top[90%,back=RGB(0,0,0)])")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1671
How can display seconds

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,96)
			oChart:FirstVisibleDate := "01/17/2008"
			oChart:LevelCount := 2
			oChart:UnitScale := 16777216/*exSecond*/
			oChart:Level(0):Alignment := 17/*exHOutside+CenterAlignment*/
			oChart:Level(1):FormatLabel := "(0:=sec(dvalue)) mod 10 ? 0=: : '<c><font ;6>sec<br><b>' + 0=:"
		oG2antt:Columns():Add("Tasks")
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/17/2008 00:00:02","01/17/2008 00:00:08")
			oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/17/2008 00:00:05","01/17/2008 00:00:15")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1670
How can I check if an item contains a bar
PROCEDURE OnSelectionChanged(oG2antt)
	LOCAL oItems
	oItems := oG2antt:Items()
		DevOut( "Count of A: " )
		DevOut( Transform(oItems:ItemBar(oItems:FocusItem(),"A",256/*exBarsCount*/),"") )
		DevOut( "Count of B: " )
		DevOut( Transform(oItems:ItemBar(oItems:FocusItem(),"B",256/*exBarsCount*/),"") )
		DevOut( "Count of C: " )
		DevOut( Transform(oItems:ItemBar(oItems:FocusItem(),"C",256/*exBarsCount*/),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:SelectionChanged := {|| OnSelectionChanged(oG2antt)} /*Fired after a new item has been selected.*/

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,48)
			oChart:Bars:Item("Task"):SetProperty("Def",4/*exBarHAlignCaption*/,18)
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task"),"Task","01/02/2001","01/04/2001","A","A")
			oItems:AddBar(oItems:AddItem("Task"),"Task","01/02/2001","01/04/2001","B","B")
			oItems:AddBar(oItems:AddItem("Task"),"Task","01/02/2001","01/04/2001","C","C")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1669
How can I connect to a DBF file
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:ColumnAutoResize := .F.
		oG2antt:ContinueColumnScroll := .F.
		rs := CreateObject("ADODB.Recordset")
			rs:Open("Select * From foxcode.DBF","Provider=vfpoledb;Data Source=C:\Program Files\Microsoft Visual FoxPro 9\",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oG2antt:DataSource := rs
		oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1668
How do I get the caption with no HTML format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:Columns():Add("Default")
		oItems := oG2antt:Items()
			h := oItems:AddItem("This is a bit of <b>HTML-formatted</b> text")
			oItems:SetProperty("CellValueFormat",h,0,1/*exHTML*/)
			oItems:AddItem(oItems:CellCaption(h,0))

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1667
How can I change the bar's color based on its length/duration

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oConditionalFormat
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oColumns := oG2antt:Columns()
			oColumns:Add("Tasks")
			oColumn := oColumns:Add("Duration")
				oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513)
				oColumn:Editor():EditType := 4/*SpinType*/
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oChart := oG2antt:Chart()
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "06/06/2005"
			oChart:SetProperty("PaneWidth",.F.,128)
		oConditionalFormat := oG2antt:ConditionalFormats():Add("%1 >= 4")
			oConditionalFormat:ApplyTo := 1/*0x1+*/
			oConditionalFormat:Bold := .T.
			oConditionalFormat:ApplyToBars := "Task"
			oConditionalFormat:SetProperty("BarColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oConditionalFormat:SetProperty("ForeColor",oConditionalFormat:BarColor())
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/10/2005","06/13/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/11/2005","06/16/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/12/2005","06/15/2005","")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1666
Is it possible to colorize the bars based on its starting/ending date

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oConditionalFormat
	LOCAL oInsideZoomFormat
	LOCAL oInsideZooms
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:OnResizeControl := 129/*exDisableSplitter+exResizeChart*/
		oColumns := oG2antt:Columns()
			oColumns:Add("Tasks")
			oColumn := oColumns:Add("Start")
				oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
				oColumn:Visible := .F.
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oChart := oG2antt:Chart()
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "05/31/2005"
			oChart:SetProperty("PaneWidth",.F.,0)
			oChart:AllowInsideZoom := .T.
			oChart:AllowResizeInsideZoom := .F.
			oChart:InsideZoomOnDblClick := .F.
			oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
				oInsideZoomFormat:PatternChart := 6/*exPatternBDiagonal*/
				oInsideZoomFormat:SetProperty("PatternColorChart",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
				oInsideZoomFormat:SetProperty("ForeColor",oInsideZoomFormat:PatternColorChart())
			oInsideZooms := oChart:InsideZooms()
				oInsideZooms:SplitBaseLevel := .F.
				oInsideZooms:DefaultWidth := 18
				oInsideZooms:Add("06/10/2005"):AllowInsideFormat := .F.
		oConditionalFormat := oG2antt:ConditionalFormats():Add("%1 <= #6/10/2005#")
			oConditionalFormat:ApplyToBars := "Task"
			oConditionalFormat:SetProperty("BarColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/10/2005","06/14/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/11/2005","06/15/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/12/2005","06/16/2005","")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1665
How can I change the bar's color based on values on the columns

PROCEDURE OnAddItem(oG2antt,Item)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oConditionalFormat,oConditionalFormat1,oConditionalFormat2
	LOCAL oConditionalFormats
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "08/03/1994"
			oChart:SetProperty("PaneWidth",.F.,256)
			oChart:LevelCount := 2
			oChart:UnitScale := 4096/*exDay*/
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/
		oG2antt:ColumnAutoResize := .F.
		oG2antt:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oG2antt:DataSource := rs
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oG2antt:Columns:Item(2):SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
		oG2antt:Columns:Item(4):SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
		oConditionalFormats := oG2antt:ConditionalFormats()
			oConditionalFormat := oConditionalFormats:Add("1")
				oConditionalFormat:ApplyTo := 1/*0x1+*/
				oConditionalFormat:Bold := .T.
				oConditionalFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 250,250,250 } )  , .F. ))
			oConditionalFormat1 := oConditionalFormats:Add("%1 = 5")
				oConditionalFormat1:ApplyToBars := "Task"
				oConditionalFormat1:SetProperty("BarColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
				oConditionalFormat1:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
				oConditionalFormat1:SetProperty("BarOverviewColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oConditionalFormat2 := oConditionalFormats:Add("%1 = 3")
				oConditionalFormat2:ApplyToBars := "Task"
				oConditionalFormat2:SetProperty("BarColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
				oConditionalFormat2:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
				oConditionalFormat2:SetProperty("BarOverviewColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1664
How can I display / specify a fixed percent for the task in the histogram, no matter how long the task is

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar,oBar1,oBar2
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DefaultItemHeight := 32
		oG2antt:Columns():Add("Tasks")
		oChart := oG2antt:Chart()
			oChart:UnitWidth := 32
			oChart:LevelCount := 2
			oChart:NonworkingDays := 0
			oChart:SetProperty("PaneWidth",.F.,64)
			oChart:FirstVisibleDate := "06/20/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oChart:HistogramHeight := 64
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramType := 1/*exHistOverAllocation*/
				oBar:ShowHistogramValues := Transform(1,"")
			oBar1 := oChart:Bars():CallMethod("Copy","Task","TaskFixed")
				oBar1:HistogramType := 513/*exHistOverAllocationFixed+exHistOverAllocation*/
				oBar1:ShowHistogramValues := Transform(1,"")
			oBar2 := oChart:Bars():CallMethod("Copy","Task","TaskMultiply")
				oBar2:HistogramType := 1025/*exHistOverAllocationMultiply+exHistOverAllocation*/
				oBar2:ShowHistogramValues := Transform(1,"")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Allocation")
			oItems:AddBar(h,"Task","06/21/2005","06/23/2005","A","Effort/Length")
			oItems:SetProperty("ItemBar",h,"A",21/*exBarEffort*/,0.25)
			oItems:SetProperty("ItemBar",h,"A",5/*exBarVAlignCaption*/,18)
			oItems:AddBar(h,"TaskFixed","06/24/2005","06/26/2005","B","Effort")
			oItems:SetProperty("ItemBar",h,"B",21/*exBarEffort*/,0.25)
			oItems:SetProperty("ItemBar",h,"B",5/*exBarVAlignCaption*/,18)
			oItems:AddBar(h,"TaskMultiply","06/27/2005","06/29/2005","C","Effort*Length")
			oItems:SetProperty("ItemBar",h,"C",21/*exBarEffort*/,0.25)
			oItems:SetProperty("ItemBar",h,"C",5/*exBarVAlignCaption*/,18)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1663
Does your control supports scrolling by touching the screen

PROCEDURE OnAddItem(oG2antt,Item)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "08/03/1994"
			oChart:SetProperty("PaneWidth",.F.,256)
			oChart:LevelCount := 2
			oChart:UnitScale := 4096/*exDay*/
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/
		oG2antt:ColumnAutoResize := .F.
		oG2antt:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oG2antt:DataSource := rs
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oG2antt:Columns:Item(2):SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
		oG2antt:Columns:Item(4):SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
		oG2antt:ContinueColumnScroll := .T.
		oG2antt:ScrollBySingleLine := .T.
		oG2antt:Chart():AllowCreateBar := 0/*exNoCreateBar*/
		oG2antt:AutoDrag := 4112/*exAutoDragScrollOnShortTouch+exAutoDragScroll*/
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1662
Is it possible to use build-in zoom-functionality to zoom time periods spanning to just some hours of one day (zoom-onfly)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:UnitScale := 4096/*exDay*/
			oChart:SetProperty("PaneWidth",.F.,0)
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:DrawGridLines := -1/*exAllLines*/
			oChart:AllowZoomOnFly := 24/*exZoomOnFly*/
			oChart:ResizeUnitScale := 65536/*exHour*/
			oChart:ResizeUnitCount := 4
			oChart:SetProperty("Label",65536/*exHour*/,"<font ;5><b><%h%><br><%AM/PM%></b></font><||>4<||>65536")
			oChart:ZoomOnFlyCaption := "<br><c><b><font ;12><%=%C0%>"
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task 1")
			oItems:AddBar(h,"Task","01/07/2001","01/10/2001","T1","T1")
			oItems:AddBar(h,"Task","01/11/2001","01/14/2001","T3","T3")
			h := oItems:AddItem()
			oItems:AddBar(h,"","01/15/2001","01/15/2001","","Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.")
			oItems:SetProperty("SelectableItem",h,.F.)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1661
Is it possible to use build-in zoom-functionality to zoom time periods spanning to just some hours of one day (inside-zoom)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oInsideZoomFormat
	LOCAL oInsideZooms

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:UnitScale := 4096/*exDay*/
			oChart:SetProperty("PaneWidth",.F.,0)
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "01/01/2008"
			oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
				oInsideZoomFormat:InsideLabel := "<%hh%>"
				oInsideZoomFormat:InsideUnit := 65536/*exHour*/
				oInsideZoomFormat:InsideCount := 8
			oChart:AllowInsideZoom := .T.
			oInsideZooms := oChart:InsideZooms()
				oInsideZooms:Add("01/04/2008")
			oChart:DrawGridLines := -1/*exAllLines*/
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1660
How can I export the control's content to a PDF document (method 1)
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn,oColumn1
	LOCAL oColumns
	LOCAL oPrint
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:MarkSearchColumn := .F.
		oColumns := oG2antt:Columns()
			oColumns:Add("Tasks")
			oColumn := oColumns:Add("Start")
				oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
				oColumn:Editor():EditType := 4/*SpinType*/
			oColumn1 := oColumns:Add("End")
				oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
				oColumn1:Editor():EditType := 4/*SpinType*/
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,196)
			oChart:LevelCount := 2
			oChart:ShowEmptyBars := 1
			oChart:FirstVisibleDate := "01/01/2009"
		oItems := oG2antt:Items()
			oItems:AllowCellValueToItemBar := .T.
			oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2009","01/07/2009")
			oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/04/2009","01/09/2009")
		oPrint := CreateObject("Exontrol.Print")
			oPrint:PrintExt := oG2antt
			oPrint:CopyTo("c:/temp/xtest.pdf")
		DevOut( "Look for C:\Temp\xtest.pdf file." )
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1659
How can I export the control's content to a PDF document (method 2)
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn,oColumn1
	LOCAL oColumns
	LOCAL oItems
	LOCAL var_CopyTo

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:MarkSearchColumn := .F.
		oColumns := oG2antt:Columns()
			oColumns:Add("Tasks")
			oColumn := oColumns:Add("Start")
				oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
				oColumn:Editor():EditType := 4/*SpinType*/
			oColumn1 := oColumns:Add("End")
				oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
				oColumn1:Editor():EditType := 4/*SpinType*/
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,196)
			oChart:LevelCount := 2
			oChart:ShowEmptyBars := 1
			oChart:FirstVisibleDate := "01/01/2009"
		oItems := oG2antt:Items()
			oItems:AllowCellValueToItemBar := .T.
			oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2009","01/07/2009")
			oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/04/2009","01/09/2009")
		var_CopyTo := oG2antt:CopyTo("c:/temp/xtest.pdf")
		DevOut( "Look for C:\Temp\xtest.pdf file." )
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1658
Today date is shown, if we use the Column.FormatColumn and Editor.Option(exDateAllowNullDate) properties. What can be done

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oColumn := oG2antt:Columns():Add("Date")
			oColumn:FormatColumn := "len(value) ? ( (longdate(date(value)) left 3) + ' ' + day(date(value)) + '/' + month(date(value)) + '/' + (year(date(value)) right 2) ) : '' )"
			oEditor := oColumn:Editor()
				oEditor:EditType := 7/*DateType*/
				oEditor:SetProperty("Option",14/*exDateAllowNullDate*/,.T.)
		oItems := oG2antt:Items()
			oItems:AddItem("05/12/2012")
			oItems:AddItem()
			oItems:AddItem("05/14/2012")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1657
Is there a syntax for conditional formatting of items, based on CellState/CellStateChange

PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:SetProperty("CellValue",Item,2,oItems:CellState(Item,0))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL var_ConditionalFormat
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/

		oG2antt:BeginUpdate()
		oG2antt:ShowFocusRect := .F.
		oG2antt:SelBackMode := 1/*exTransparent*/
		var_ConditionalFormat := oG2antt:ConditionalFormats:Add("%2 != 0")
			var_ConditionalFormat:Bold := .T.
			var_ConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			var_ConditionalFormat:ApplyTo := -1/*exFormatToItems*/
		oColumn := oG2antt:Columns():Add("")
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oColumn:Width := 16
			oColumn:AllowSizing := .F.
		oG2antt:Columns():Add("Information")
		oG2antt:Columns():Add("Hidden"):Visible := .F.
		oItems := oG2antt:Items()
			oItems:SetProperty("CellValue",oItems:AddItem(""),1,"This is a bit of text associated")
			h := oItems:AddItem("")
			oItems:SetProperty("CellValue",h,1,"This is a bit of text associated")
			oItems:SetProperty("CellState",h,0,1)
			oItems:SetProperty("CellValue",oItems:AddItem(""),1,"This is a bit of text associated")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1656
How can I hide the items/grid section of the control

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:OnResizeControl := 129/*exDisableSplitter+exResizeChart*/
		oG2antt:Columns():Add("Tasks")
		oChart := oG2antt:Chart()
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "06/09/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oChart:HistogramHeight := 128
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
			oChart:SetProperty("PaneWidth",.F.,0)
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/10/2005","06/14/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/11/2005","06/15/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/12/2005","06/16/2005","")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1655
How can I draw an extra line which could indicate deadline for my tasks

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oAppearance
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DefaultItemHeight := 24
		oAppearance := oG2antt:VisualAppearance()
			oAppearance:Add(2,"gBFLBCJwBAEHhEJAAChABLMIQAAYAQGKIaBoAKBQAGaAoDDQOQ4QwAAxjAKUEwsACEIrjKCYVgOHYYRrIIEvZAAMIlSbCMoxcAsSQSf6YJBmKL4fiWMobRCMQyiLLMdwiGoYJ4hGgKChqI43RZNErURRkEwCgIA=")
			oAppearance:Add(1,"CP:2 0 -4 0 4")
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,128)
		oItems := oG2antt:Items()
			h := oItems:AddItem("Default")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K1")
			oItems:SetProperty("ItemBar",h,"K1",51/*exBarFrameColor*/,16777471)
			oItems:AddBar(h,"Task","01/09/2001","01/14/2001","K2")
			oItems:SetProperty("ItemBar",h,"K2",51/*exBarFrameColor*/,33488896)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1654
How can I mark/highlight a zone in the control's histogram

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oChart := oG2antt:Chart()
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:LevelCount := 2
			oChart:SetProperty("PaneWidth",.F.,40)
			oChart:FirstVisibleDate := "06/09/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oChart:HistogramHeight := 128
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramType := 0/*exHistOverload*/
				oBar:HistogramItems := 12
				oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/10/2005","06/14/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/11/2005","06/15/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/12/2005","06/16/2005","")
		oG2antt:Chart():MarkTimeZone("zone","06/13/2005","06/14/2005",15790320,";;;;histogram;1")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1653
How can I get the min/max values from the histogram
PROCEDURE OnMouseMove(oG2antt,Button,Shift,X,Y)
	LOCAL oChart
	oChart := oG2antt:Chart()
		DevOut( "Value" )
		DevOut( Transform(oChart:HistogramValue(oChart:DateFromPoint(-1,-1)),"") )
		DevOut( "MIN" )
		DevOut( Transform(oChart:HistogramValue("min"),"") )
		DevOut( "MAX" )
		DevOut( Transform(oChart:HistogramValue("max"),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oG2antt,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oChart := oG2antt:Chart()
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:LevelCount := 2
			oChart:SetProperty("PaneWidth",.F.,40)
			oChart:FirstVisibleDate := "06/09/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oChart:HistogramHeight := 128
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramType := 0/*exHistOverload*/
				oBar:HistogramItems := 12
				oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/10/2005","06/14/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/11/2005","06/15/2005","")
			oItems:AddBar(oItems:AddItem("Task"),"Task","06/12/2005","06/16/2005","")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1652
How can I assign different efforts(expression) to the same bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oChart := oG2antt:Chart()
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:LevelCount := 2
			oChart:SetProperty("PaneWidth",.F.,40)
			oChart:FirstVisibleDate := "06/09/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oChart:HistogramHeight := 128
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramType := 0/*exHistOverload*/
				oBar:HistogramItems := 12
				oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
			oChart:Level(1):Label := "<font ;3><%d%>"
			oChart:UnitWidth := 9
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/10/2005","06/14/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"weekday(value) in (0,6) ? 0.25 : 2")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/18/2005","06/21/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"weekday(value) = 1 ? 2 : 1")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/27/2005","07/09/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"month (value) = 7 ? 1 : 0")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/27/2005","07/05/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"(month(value)=month(value+1)) ? 1 : 0")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/22/2005","06/26/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"int(value-start) ? 1 : 2")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","07/10/2005","07/14/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"(int(value-start) and int(end-value) != 0 ) ? 1 : 2")
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","07/15/2005","07/22/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"(int(value-start)+1) mod 2 ? 1 : 0")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1651
How can I prevent showing the representation of the bar on the week days, nonworking part

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:SetProperty("PaneWidth",.F.,40)
			oChart:FirstVisibleDate := "06/09/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oChart:HistogramHeight := 128
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramType := 0/*exHistOverload*/
				oBar:HistogramItems := 12
				oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","06/10/2005","06/21/2005","")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"weekday(value) in (0,6) ? 0 : 2")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1650
How do I programatically focus a cell
PROCEDURE OnFocusChanged(oG2antt)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:SetProperty("CellBackColor",oItems:FocusItem(),oG2antt:FocusColumnIndex(),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumns
	LOCAL oItems,oItems1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:FocusChanged := {|| OnFocusChanged(oG2antt)} /*Occurs when a cell gets the focus.*/

		oG2antt:BeginUpdate()
		oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor())
		oG2antt:SetProperty("SelBackColor",oG2antt:BackColor())
		oG2antt:DrawGridLines := -2/*exRowLines*/
		oColumns := oG2antt:Columns()
			oColumns:Add("Column1")
			oColumns:Add("Column2")
		oItems := oG2antt:Items()
			oItems:SetProperty("CellValue",oItems:AddItem("Cell 1.1"),1,"Cell 1.2")
			oItems:SetProperty("CellValue",oItems:AddItem("Cell 2.1"),1,"Cell 2.2")
		oItems1 := oG2antt:Items()
			oItems1:SetProperty("SelectItem",oItems1:ItemByIndex(1),.T.)
		oG2antt:FocusColumnIndex := 1
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1649
How do I programatically focus a cell (excrd)
PROCEDURE OnFocusChanged(oG2antt)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:SetProperty("CellBackColor",oItems:FocusItem(),oG2antt:FocusColumnIndex(),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems,oItems1
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:FocusChanged := {|| OnFocusChanged(oG2antt)} /*Occurs when a cell gets the focus.*/

		oG2antt:BeginUpdate()
		oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor())
		oG2antt:SetProperty("SelBackColor",oG2antt:BackColor())
		oG2antt:DrawGridLines := -2/*exRowLines*/
		oG2antt:DefaultItemHeight := 36
		oColumns := oG2antt:Columns()
			oColumns:Add("Column1"):Visible := .F.
			oColumns:Add("Column2"):Visible := .F.
			oColumns:Add("Column3"):Visible := .F.
			oColumn := oColumns:Add("FormatLevel")
				oColumn:FormatLevel := "(0/1),2"
				oColumn:SetProperty("Def",32/*exCellFormatLevel*/,oColumn:FormatLevel())
		oItems := oG2antt:Items()
			h := oItems:AddItem("Cell 1.1")
			oItems:SetProperty("CellValue",h,1,"Cell 1.2")
			oItems:SetProperty("CellValue",h,2,"Cell 1.3")
			h := oItems:AddItem("Cell 2.1")
			oItems:SetProperty("CellValue",h,1,"Cell 2.2")
			oItems:SetProperty("CellValue",h,2,"Cell 2.3")
		oItems1 := oG2antt:Items()
			oItems1:SetProperty("SelectItem",oItems1:ItemByIndex(1),.T.)
		oG2antt:FocusColumnIndex := 2
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1648
How can I get task's user data ( exBarData ) when user double clicks the bar
PROCEDURE OnDblClick(oG2antt,Shift,X,Y)
	LOCAL item,key
	item := oG2antt:ItemFromPoint(-1,-1,c,hit)
	key := oG2antt:Chart:BarFromPoint(-1,-1)
	DevOut( Transform(oG2antt:Items:ItemBar(item,key,17/*exBarData*/),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:DblClick := {|Shift,X,Y| OnDblClick(oG2antt,Shift,X,Y)} /*Occurs when the user dblclk the left mouse button over an object.*/

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oG2antt:Chart():FirstVisibleDate := "01/01/2001"
		oG2antt:Chart():SetProperty("PaneWidth",.F.,48)
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task 1")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","")
			oItems:SetProperty("ItemBar",h,"",17/*exBarData*/,"this is a bit of extra data associated with task 1")
			h := oItems:AddItem("Task 2")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","")
			oItems:SetProperty("ItemBar",h,"",17/*exBarData*/,"this is a bit of extra data associated with task 2")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1647
How do I get arranged the levels to display, weeks, days and so on

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oLevel,oLevel1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:UnitWidth := 24
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,0)
			oChart:LevelCount := 2
			oChart:FirstWeekDay := 1/*exMonday*/
			oLevel := oChart:Level(0)
				oLevel:Alignment := 1/*CenterAlignment*/
				oLevel:Label := "<b><Font Tahoma;7><%m3%>, <%yyyy%></b><b>, <Font Tahoma;7>Wk <%ww%>"
				oLevel:Unit := 256/*exWeek*/
				oLevel:DrawGridLines := .T.
			oLevel1 := oChart:Level(1)
				oLevel1:Alignment := 1/*CenterAlignment*/
				oLevel1:Label := "<Font Tahoma;7><%d%>"
				oLevel1:Unit := 4096/*exDay*/
			oChart:DrawGridLines := -1/*exAllLines*/
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1646
How can I add a task and a milestone to the same item
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:Columns():Add("Task")
		oG2antt:Chart():FirstVisibleDate := "01/01/2001"
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task 1")
			oItems:AddBar(h,"Milestone","01/02/2001","01/02/2001","MKey")
			oItems:AddBar(h,"Task","01/03/2001","01/07/2001")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1645
How can I change the visual appearance of the buttons on the control's overview part

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAADhABdQFg6AADACAxRDAMgBQKAAzQFAYawdBgABoGUZ4JhUAIIRZGMIjFDcEwxC6NIpAWCYQDENQwSSMMJwSKYYBiASEYJASQZUhmHIDTbIEBxfIMIRLE6PZbmEYYfgeNY6TQCcIgVD0ExhAZ2Q4EQAKRpOFY/DBQNLgAKNCQ3LaQY7BaKgZouTYDVrVNSVFC0IBkGoSbauCIJHrGCZ1RBYMI0VDNRwHJiMbRtSyqXjGJ4pSrAcq0FAgYRHI6jZxnGL5chqPqGVjMNZ1bQuKwzT0Ld5wTYsdydBK1MIkTKKaoORZgRpYUI6FAeSgBWyPcCqPSoDrKdo4XLdYwbeAFcSPD6+NBhG7tXm/NarNTgTB6DBthsGJbgYYw9AQVxBoOch2hEbh+nAARYkQdZ7CMPYGH+FxmlqbJ5lqDAdjMC5AmIW54hwaBvA4IQ8D+T8IFscgenAAZMHiEgWiWdRZlSAAhAkFAGq6dAdEcIYVF4QJKCA" +;
		"HQDBCBJYGUGQNhCEIhiSCJaGAYQWBsIYmEEFgJAGQ42CyC4iliPgygsT4olSXg3g2Qwwk0MpMiMLJIg8Y54niTYOmPPJMDMDIonSSU7jMJJbDaTYjlYUoMmMCRWFQAAlEkZgtDgTgjgCJQpEoIgkgkIQHnIAB7CACARnIaIaiaGYuG6GxmhmFB7CGSICAyHwoAmQxQlQNIlikWgthYIwaAYVQvAuQpsg0IxIhKTIzCwToTiiaYACkChGhKJJpEOQoWC+C5imyCgiggYpUzMZ5Yj6AIfg6UpcjgLYInIPILhOTYaEIUg9EoItfCGCByAiCV2lIKILCGK4qnKO4YggWpQgIJxJmIaJhDgDgKECaIykkUhUhILQLEKRh9iiYpzCSSQxmgcgkm2NppAKbI8C4RoBiQYgSgSMQQEEEIDjECBDA8LorjKa47EQMQSm4DpEhEKBDBeRgBGqMQnmkA5in4JAJAINoEC6JR4jyaQ6E6AhEhIIxNBMRJPiQCYyHCGA" +;
		"UgUMQwEgEhhkEOBHBOBJxCMHJHjGXB/CKSBxlENwaj1qgsEwERICIDB/iQDgjgiYYvE2cx8l2KIinoEI5CYSYiFqEAz0mMBZBbwIkEsEN+gMSpSHSTITEqSoEFyGBHCoSoihqEAsgsIo8ikKhKGiVJ6AADwTkicQlAkUhElA+Z4VUHpHGuRA8lMdI9DscJc8r5QQAaIYsGUOpOjoOwHCEJAUgBh8B1EAAcHIzg5gPCGNgdQfRPhnGiLINhhQEDCBcGUDYphxjLHkNgfwTARhiHEBYWAVxpI1HQDcDjthiAADoKcCgJgbs7FyG4LQagBBgE0CMOYOxLhtGY/AcAegNgTHIPkHISAHADEQNYOA2BwAHEQHABwQxMDbCQEscoEBAAgEOD0V4cR0jyGCPAPwHAvh0EAOIHIDRfA/EaGMfYfguAACiBQIg/xWAbH0F8J4bxSD6G8MUMo7Q9ieHuI8eA0gLjfG2PUPQnwvhvHsPsGABxhD8E+AMbgfhVDJH2L8" +;
		"U48wAjbEGPwPo7x8j4F4FccwHAhhiEgBQEQhAnCDGgHwBonxiAZD+G8Lo/hHj3H8PELIiBwgOFCNQHAqQAhYBWAUIARAECgHyKkIIqAIgGGCLgUIFAhB5CQAcFAGgcEHHKBwUYkAdiHDgOaAIKBigYCCFAFQhBzChAWKEOYzwDhCEwFMBQNxwD3C8CsPgHQhANEuA4Uw+gdhHDAOwBogRYAzFuGAQIEgQAzCSGUAIbAXAFCiKIGghhBCQAeAFIgDgwjMByEAAYXg1hiEwFgBYAQugAGIPsTodgnDSBgMca4LhqChCgD4CIYgYBDmcI4GIxgUCYAm1oPIjwgjmFQMYWA1gNCiBUqcII6gegUEAHwB4oRwhzEGLge4GAOC6HUAcMIsAbCGDqLYHYVBACTAkIIIAYigCIGcBQCArQKiiFQFERQUQhDMAOBgcIWAggUBGIMfAVAHhCBwEgBAMg+jbFqCcHYLxvg4D2A8QI3AziMHiJoUgFhACyCwIINofwHi" +;
		"JDAJUKw2B2ARGEEAIwCxIh2BaNQQA/ROBRGoFYQ48B/AeEGEt99lQOgDFgGcAtFgdgHEANIMAhAIDKAygkQAEAAjxBeIoCI7QfjUEEEwDIIgWBFEQHUSANxsAqEEEUdwlA4iJCSFYEwhBsCXE0KoIAexnj4DoDkEwaBmgYCGAwMADAkCFCMMYAQOgMhQEIHsaIVQQDXFOOgRtwAUguAcAUU1iw1CWA6OwdIOQFBxCgCkDgeBribBmIgP4KQiAAB+KoAg2QNiDDoG0BQyQzg+EGOAWAFgRC4DsEURQYAdhWFKAoKAVQAB/AcHEaAORiioFqBYMWFATCZEsBsIYcA0gMGCJwGAhg4DQAwKsDAYQGzZBkAcSA8gODEBEGQVIQhajUEeeYKY1QIDrBCIAEg0xIAwEgBNkAAADUTA6B4MQEwv0UEGLAUgzhf04AKGEg4BhYD2B0MUAABApAAvqI8WAqAdDGGwJsEIXwWDtE0AAA4fhmDZCmJMMwbBkgBIC")
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,0)
			oChart:LevelCount := 2
			oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/
			oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/
			oChart:SetProperty("Label",16777216/*exSecond*/,"")
			oChart:SetProperty("Label",0/*exYear*/,"")
		oG2antt:Chart():SetProperty("OverviewSelBackColor",0x1ffff00)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1644
Is there a way to show the Start and End dates in mm-dd-yyyy format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn,oColumn1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:MarkSearchColumn := .F.
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "12/25/2000"
			oChart:SetProperty("PaneWidth",.F.,196)
		oColumn := oG2antt:Columns():Add("Start")
			oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
			oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"K1")
			oColumn:FormatColumn := "(0 array (0:=(shortdateF(value) split `/`))) + `-` + (1 array (=:0) ) + `-` + (2 array (=:0) )"
		oColumn1 := oG2antt:Columns():Add("End")
			oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
			oColumn1:SetProperty("Def",19/*exCellValueToItemBarKey*/,"K1")
			oColumn1:FormatColumn := "shortdateF(value) replace `/` with `-`"
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem(),"Task","01/01/2001","01/05/2001","K1")
			oItems:AddBar(oItems:AddItem(),"Task","01/02/2001","01/06/2001","K1")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1643
Is there a way to show the Start and End dates in dd-mm-yyyy format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn,oColumn1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:MarkSearchColumn := .F.
		oG2antt:Items():AllowCellValueToItemBar := .T.
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:FirstVisibleDate := "12/25/2000"
			oChart:SetProperty("PaneWidth",.F.,196)
		oColumn := oG2antt:Columns():Add("Start")
			oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
			oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"K1")
			oColumn:FormatColumn := "(1 array (0:=(shortdateF(value) split `/`))) + `-` + (0 array (=:0) ) + `-` + (2 array (=:0) )"
		oColumn1 := oG2antt:Columns():Add("End")
			oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
			oColumn1:SetProperty("Def",19/*exCellValueToItemBarKey*/,"K1")
			oColumn1:FormatColumn := "(1 array (0:=(shortdateF(value) split `/`))) + `-` + (0 array (=:0) ) + `-` + (2 array (=:0) )"
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem(),"Task","01/01/2001","01/05/2001","K1")
			oItems:AddBar(oItems:AddItem(),"Task","01/02/2001","01/06/2001","K1")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1642
If we have bars with dark color, we use white font/color. But if the bars are too small for the caption, you can’t read it. What can we do

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar,oBar1,oBar2
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oG2antt:Chart():FirstVisibleDate := "12/29/2000"
		oG2antt:Chart():SetProperty("PaneWidth",.F.,48)
		oBar := oG2antt:Chart():Bars:Item("Task")
			oBar:Pattern := 1/*exPatternSolid*/
			oBar:Height := 17
		oBar1 := oG2antt:Chart():Bars:Item("Progress")
			oBar1:Pattern := 1/*exPatternSolid*/
			oBar1:Height := 17
			oBar1:Shape := 1/*exShapeSolid*/
			oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
		oBar2 := oG2antt:Chart():Bars():Add("Task%Progress")
			oBar2:Pattern := 1/*exPatternSolid*/
			oBar2:Height := 17
			oBar2:Shortcut := "Percent"
		oG2antt:DefaultItemHeight := 21
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task 1")
			oItems:AddBar(h,"Task","01/02/2001","01/05/2001","")
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,4112616)
			oItems:SetProperty("ItemBar",h,"",3/*exBarCaption*/,"<fgcolor=FFFFFF><sha 0;;0>Pause")
			oItems:AddBar(h,"Task","01/09/2001","01/12/2001","white")
			oItems:SetProperty("ItemBar",h,"white",33/*exBarColor*/,4112616)
			oItems:SetProperty("ItemBar",h,"white",3/*exBarCaption*/,"<fgcolor=FFFFFF>Pause")
			h := oItems:AddItem("Task 2")
			oItems:AddBar(h,"Task","01/03/2001","01/04/2001","")
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,2017557)
			oItems:SetProperty("ItemBar",h,"",3/*exBarCaption*/,"<fgcolor=FFFFFF><sha 0;;0>Production")
			oItems:AddBar(h,"Task","01/10/2001","01/11/2001","white")
			oItems:SetProperty("ItemBar",h,"white",33/*exBarColor*/,2017557)
			oItems:SetProperty("ItemBar",h,"white",3/*exBarCaption*/,"<fgcolor=FFFFFF>Production")
			h := oItems:AddItem("Task 3")
			oItems:AddBar(h,"Percent","01/03/2001","01/04/2001","")
			oItems:SetProperty("ItemBar",h,"",12/*exBarPercent*/,0.5)
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,2017557)
			oItems:SetProperty("ItemBar",h,"",3/*exBarCaption*/,"<fgcolor=FFFFFF><sha 0;;0>Pausing")
			oItems:AddBar(h,"Percent","01/10/2001","01/11/2001","white")
			oItems:SetProperty("ItemBar",h,"white",12/*exBarPercent*/,0.5)
			oItems:SetProperty("ItemBar",h,"white",33/*exBarColor*/,2017557)
			oItems:SetProperty("ItemBar",h,"white",3/*exBarCaption*/,"<fgcolor=FFFFFF>Pausing")
			h := oItems:AddItem("Task 4")
			oItems:AddBar(h,"Task","01/03/2001","01/04/2001","")
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,8421504)
			oItems:SetProperty("ItemBar",h,"",3/*exBarCaption*/,"<fgcolor=FFFFFF><sha 0;;0>Planned downtime")
			oItems:AddBar(h,"Task","01/10/2001","01/11/2001","white")
			oItems:SetProperty("ItemBar",h,"white",33/*exBarColor*/,8421504)
			oItems:SetProperty("ItemBar",h,"white",3/*exBarCaption*/,"<fgcolor=FFFFFF>Planned downtime")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1641
How do I programmatically exclude items from the filter

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn,oColumn1
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumn := oG2antt:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 9472/*exShowExclude+exShowFocusItem+exShowCheckBox*/
		oItems := oG2antt:Items()
			oItems:AddItem("Item 1")
			oItems:AddItem("Item 2")
			oItems:AddItem("Item 3")
			oItems:AddItem("Item 4")
		oColumn1 := oG2antt:Columns:Item(0)
			oColumn1:FilterType := 752/*exFilterExclude+exFilter*/
			oColumn1:Filter := "Item 1|Item 4"
		oG2antt:ApplyFilter()
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1640
How do I show in histogram, more values for a single task

PROCEDURE OnBeforeExpandItem(oG2antt,Item,Cancel)
	Cancel := .T.
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h,hR

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeforeExpandItem := {|Item,Cancel| OnBeforeExpandItem(oG2antt,Item,Cancel)} /*Fired before an item is about to be expanded (collapsed).*/

		oG2antt:BeginUpdate()
		oG2antt:SingleSel := .T.
		oG2antt:ExpandOnDblClick := .F.
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:AllowLinkBars := .F.
			oChart:DrawGridLines := -1/*exAllLines*/
			oChart:FirstVisibleDate := "12/29/2000"
			oChart:HistogramVisible := .T.
			oChart:HistogramHeight := 167
			oChart:SetProperty("PaneWidth",.F.,128)
			oChart:HistogramView := 1040/*exHistogramNoGrouping+exHistogramUnlockedItems*/
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramType := 256/*exHistCumulative*/
				oBar:HistogramItems := 6
				oBar:HistogramPattern := 1/*exPatternSolid*/
				oBar:HistogramItems := -40000
				oBar:HistogramCriticalValue := 100000
				oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
				oBar:HistogramCumulativeColors := 3
			oChart:ShowNonworkingDates := .F.
		oG2antt:Columns():Add("Costs"):Visible := .F.
		oG2antt:Columns():Add("Tasks"):Visible := .T.
		oItems := oG2antt:Items()
			h := oItems:AddItem("Estimated")
			oItems:SetProperty("CellValue",h,1,"Task 1")
			oItems:AddBar(h,"Task","01/01/2001","01/10/2001")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,8000)
			hR := oItems:InsertItem(h,,"Actual")
			oItems:AddBar(hR,"Task","01/01/2001","01/10/2001")
			oItems:SetProperty("ItemBar",hR,"",21/*exBarEffort*/,9000)
			oItems:GroupBars(h,"",.T.,hR,"",.T.)
			oItems:GroupBars(h,"",.F.,hR,"",.F.)
			hR := oItems:InsertItem(h,,"Cost")
			oItems:AddBar(hR,"Task","01/01/2001","01/10/2001")
			oItems:SetProperty("ItemBar",hR,"",21/*exBarEffort*/,200)
			oItems:GroupBars(h,"",.T.,hR,"",.T.)
			oItems:GroupBars(h,"",.F.,hR,"",.F.)
			h := oItems:AddItem("Estimated")
			oItems:SetProperty("CellValue",h,1,"Task 2")
			oItems:AddBar(h,"Task","01/09/2001","01/15/2001")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,7000)
			hR := oItems:InsertItem(h,,"Actual")
			oItems:AddBar(hR,"Task","01/09/2001","01/15/2001")
			oItems:SetProperty("ItemBar",hR,"",21/*exBarEffort*/,8000)
			oItems:GroupBars(h,"",.T.,hR,"",.T.)
			oItems:GroupBars(h,"",.F.,hR,"",.F.)
			hR := oItems:InsertItem(h,,"Cost")
			oItems:AddBar(hR,"Task","01/09/2001","01/15/2001")
			oItems:SetProperty("ItemBar",hR,"",21/*exBarEffort*/,150)
			oItems:GroupBars(h,"",.T.,hR,"",.T.)
			oItems:GroupBars(h,"",.F.,hR,"",.F.)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1639
How can I align the caption of the bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "12/25/2000"
			oChart:SetProperty("PaneWidth",.F.,48)
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","exBarHAlignCaption = 0")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,0)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","exBarHAlignCaption = 1")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,1)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","exBarHAlignCaption = 2")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,2)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","Clip 3")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,3)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","Clip 4")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,4)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","Clip 5")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,5)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","Outside Left 16")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,16)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","Outside Right 18")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,18)
			h := oItems:AddItem("Task")
			oItems:AddBar(h,"Task","01/02/2001","01/06/2001","K","Outside Center 17")
			oItems:SetProperty("ItemBar",h,"K",4/*exBarHAlignCaption*/,17)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1638
How can I change the drop down filter background color

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/
		oG2antt:SetProperty("Background",26/*exBackColorFilter*/,AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
		oColumn := oG2antt:Columns():Add("Items")
			oColumn:DisplayFilterButton := .T.
			oColumn:DisplayFilterPattern := .F.
			oColumn:FilterList := 1315/*exShowFocusItem+exShowCheckBox+exSortItemsAsc+exLeafItems*/
		oItems := oG2antt:Items()
			h := oItems:AddItem("Root 1")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)
			h := oItems:AddItem("Root 2")
			oItems:InsertItem(h,,"Child 1")
			oItems:InsertItem(h,,"Child 2")
			oItems:InsertItem(h,,"Child 3")
			oItems:SetProperty("ExpandItem",h,.T.)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1637
How can I arrange the columns using CRD (eXCRD ) strings (Sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn,oColumn1,oColumn2
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DrawGridLines := -1/*exAllLines*/
		oG2antt:DefaultItemHeight := 36
		oColumns := oG2antt:Columns()
			oColumn := oColumns:Add("C1")
				oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
				oColumn:Width := 18
				oColumn:AllowSizing := .F.
			oColumn1 := oColumns:Add("C2")
				oColumn1:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
				oColumn1:Width := 18
			oColumns:Add("Column1"):Visible := .F.
			oColumns:Add("Column2"):Visible := .F.
			oColumns:Add("Column3"):Visible := .F.
			oColumn2 := oColumns:Add("FormatLevel")
				oColumn2:FormatLevel := "18;" + CHR(34) + "Info" + CHR(34) + "[a=17]/(2/3,4)"
				oColumn2:SetProperty("Def",32/*exCellFormatLevel*/,"2/3,4")
		oChart := oG2antt:Chart()
			oChart:DrawGridLines := -1/*exAllLines*/
			oChart:FirstVisibleDate := "06/22/2014"
		oItems := oG2antt:Items()
			h := oItems:AddItem("Cell 1.1")
			oItems:SetProperty("CellValue",h,1,"Cell 1.2")
			oItems:SetProperty("CellValue",h,2,"Cell 1.3")
			oItems:AddBar(h,"Task","06/23/2014","06/25/2014")
			h := oItems:AddItem("Cell 2.1")
			oItems:SetProperty("CellValue",h,1,"Cell 2.2")
			oItems:SetProperty("CellValue",h,2,"Cell 2.3")
			oItems:AddBar(h,"Task","06/26/2014","06/28/2014")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1636
How can I arrange the columns using CRD (eXCRD ) strings (Sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DrawGridLines := -1/*exAllLines*/
		oG2antt:DefaultItemHeight := 36
		oColumns := oG2antt:Columns()
			oColumns:Add("Column1"):Visible := .F.
			oColumns:Add("Column2"):Visible := .F.
			oColumns:Add("Column3"):Visible := .F.
			oColumn := oColumns:Add("FormatLevel")
				oColumn:FormatLevel := "(0/1),2"
				oColumn:SetProperty("Def",32/*exCellFormatLevel*/,oColumn:FormatLevel())
		oChart := oG2antt:Chart()
			oChart:DrawGridLines := -1/*exAllLines*/
			oChart:FirstVisibleDate := "06/22/2014"
		oItems := oG2antt:Items()
			h := oItems:AddItem("Cell 1.1")
			oItems:SetProperty("CellValue",h,1,"Cell 1.2")
			oItems:SetProperty("CellValue",h,2,"Cell 1.3")
			oItems:AddBar(h,"Task","06/23/2014","06/25/2014")
			h := oItems:AddItem("Cell 2.1")
			oItems:SetProperty("CellValue",h,1,"Cell 2.2")
			oItems:SetProperty("CellValue",h,2,"Cell 2.3")
			oItems:AddBar(h,"Task","06/26/2014","06/28/2014")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1635
How do I display the histogram for filtered items only
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:SingleSel := .F.
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:LevelCount := 2
			oChart:HistogramVisible := .T.
			oChart:HistogramHeight := 32
			oChart:HistogramView := 128/*exHistogramFilteredItems*/
			oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/
		oColumn := oG2antt:Columns():Add("Column")
			oColumn:DisplayFilterButton := .T.
			oColumn:Filter := "Item 1"
			oColumn:FilterType := 240/*exFilter*/
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
			oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
		oG2antt:ApplyFilter()
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1634
How can I use no scroll bars for touch-screens

PROCEDURE OnAddItem(oG2antt,Item)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4))
RETURN

PROCEDURE OnMouseMove(oG2antt,Button,Shift,X,Y)
	oG2antt:ShowToolTip("<font ;6><sha ;;0><off -4>Tip</off></sha></font> If the cursor hovers bars, click and wait for a second to start scrolling.")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/
		oG2antt:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oG2antt,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:AllowCreateBar := 0/*exNoCreateBar*/
			oChart:FirstVisibleDate := "08/03/1994"
			oChart:SetProperty("PaneWidth",.F.,256)
			oChart:LevelCount := 2
			oChart:UnitScale := 4096/*exDay*/
			oChart:FirstWeekDay := 1/*exMonday*/
			oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/
		oG2antt:ColumnAutoResize := .F.
		oG2antt:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oG2antt:DataSource := rs
		oG2antt:AutoDrag := 16/*exAutoDragScroll*/
		oG2antt:ScrollWidth := 4
		oG2antt:ScrollHeight := 4
		oG2antt:SetProperty("Background",384/*exHSLeft*/,AutomationTranslateColor( GraMakeRGBColor  ( { 192,192,192 } )  , .F. ))
		oG2antt:SetProperty("Background",392/*exHSRight*/,AutomationTranslateColor( GraMakeRGBColor  ( { 192,192,192 } )  , .F. ))
		oG2antt:SetProperty("Background",404/*exHSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 224,224,224 } )  , .F. ))
		oG2antt:SetProperty("Background",388/*exHSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oG2antt:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor  ( { 224,224,224 } )  , .F. ))
		oG2antt:SetProperty("Background",264/*exVSDown*/,AutomationTranslateColor( GraMakeRGBColor  ( { 192,192,192 } )  , .F. ))
		oG2antt:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oG2antt:SetProperty("Background",256/*exVSUp*/,AutomationTranslateColor( GraMakeRGBColor  ( { 192,192,192 } )  , .F. ))
		oG2antt:ScrollButtonWidth := 0
		oG2antt:ScrollButtonHeight := 0
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1633
How can I display values in the histogram legend

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oColumn
	LOCAL oItems
	LOCAL h1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oColumn := oG2antt:Columns():Add("Effort")
			oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,21)
			oColumn:Editor():EditType := 4/*SpinType*/
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:NonworkingDays := 0
			oChart:SetProperty("PaneWidth",.F.,96)
			oChart:FirstVisibleDate := "06/20/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramHeight := 128
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramType := 0/*exHistOverload*/
				oBar:HistogramCriticalValue := 3
				oBar:HistogramItems := -7
				oBar:SetProperty("HistogramGridLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 192,192,192 } )  , .F. ))
				oBar:SetProperty("HistogramRulerLinesColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,1 } )  , .F. ))
		oItems := oG2antt:Items()
			oItems:AllowCellValueToItemBar := .T.
			h1 := oItems:AddItem("Task 1")
			oItems:AddBar(h1,"Task","06/21/2005","06/23/2005")
			oItems:SetProperty("CellValue",h1,1,4)
			h1 := oItems:AddItem("Task 2")
			oItems:AddBar(h1,"Task","06/24/2005","06/26/2005")
			oItems:SetProperty("CellValue",h1,1,3)
			h1 := oItems:AddItem("Task 3")
			oItems:AddBar(h1,"Task","06/27/2005","06/29/2005")
			oItems:SetProperty("CellValue",h1,1,2)
			h1 := oItems:AddItem("Task 4")
			oItems:AddBar(h1,"Task","06/30/2005","07/02/2005")
			oItems:SetProperty("CellValue",h1,1,1)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1632
I am using AllowGroupBy property and calling the Column.SortOrder property groups by that column. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's GroupBy bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oColumns := oG2antt:Columns()
			oColumns:Add("First")
			oColumns:Add("Second")
			oColumns:Add("Third")
		oG2antt:SortBarVisible := .T.
		oG2antt:SingleSort := .F.
		oG2antt:AllowGroupBy := .T.
		oG2antt:Layout := "SingleSort = " + CHR(34) + "C0:1" + CHR(34) + ";MultipleSort = " + CHR(34) + "C1:2 C2:1" + CHR(34) + ""

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1631
Calling programatically the Column.SortOrder property adds the column to the sort bar. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's Sort bar
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oColumns := oG2antt:Columns()
			oColumns:Add("First")
			oColumns:Add("Second")
			oColumns:Add("Third")
		oG2antt:SortBarVisible := .T.
		oG2antt:SingleSort := .F.
		oG2antt:Layout := "SingleSort = " + CHR(34) + "C0:1" + CHR(34) + ""

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1630
How can I specify different working parts for different items

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oColumn,oColumn1
	LOCAL oColumns
	LOCAL oInsideZoomFormat
	LOCAL oItems
	LOCAL h1,h2

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oColumns := oG2antt:Columns()
			oColumns:Add("Tasks")
			oColumn := oColumns:Add("Working")
				oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,258)
				oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A")
				oColumn:FormatColumn := "(0:=round(value*24)) != 0 ? =:0 : ''"
			oColumn1 := oColumns:Add("NonWorking")
				oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,259)
				oColumn1:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A")
				oColumn1:FormatColumn := "(0:=round(value*24)) != 0 ? =:0 : ''"
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,78)
			oChart:AllowCreateBar := 1/*exCreateBarAuto*/
			oChart:FirstVisibleDate := "06/20/2005"
			oChart:DrawLevelSeparator := 0/*exLevelNoLine*/
			oChart:LevelCount := 3
			oChart:Level(1):DrawGridLines := .F.
			oChart:AllowInsideZoom := .T.
			oChart:DrawDateTicker := .T.
			oChart:DateTickerLabel := "<%mmm%> <%d%><br><b><%hh%>:<%nn%></b>"
			oChart:SetProperty("MarkSelectDateColor",0x7ffff8ee)
			oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
				oInsideZoomFormat:OwnerLabel := "<%mmm%> <%d%>"
				oInsideZoomFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 238,248,255 } )  , .F. ))
				oInsideZoomFormat:SetProperty("BackColorChart",oInsideZoomFormat:BackColor())
				oInsideZoomFormat:InsideCount := 4
				oInsideZoomFormat:InsideLabel := "<b><%hh%></b>"
			oChart:InsideZooms():Add("06/22/2005")
			oChart:DrawGridLines := 2/*exVLines*/
			oChart:Bars:Item("Split"):SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oBar := oChart:Bars():Add("Task:Split")
				oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
				oBar:Pattern := 6/*exPatternBDiagonal*/
				oBar:Shortcut := "Task"
		oItems := oG2antt:Items()
			oItems:AllowCellValueToItemBar := .T.
			h1 := oItems:AddItem("Task 1")
			oItems:AddBar(h1,"Task","06/22/2005 08:00:00","06/28/2005","A")
			oItems:SetProperty("ItemBar",h1,"A",20/*exBarKeepWorkingCount*/,.T.)
			oItems:SetProperty("ItemNonworkingUnits",h1,.F.,"weekday(value) in (1,2)")
			oItems:SetProperty("ItemNonworkingUnits",h1,.T.,"weekday(value) in (1,2) or (hour(value)<8 or hour(value)>=16 )")
			h2 := oItems:AddItem("Task 1")
			oItems:AddBar(h2,"Task","06/22/2005 04:00:00","06/29/2005 12:00:00","A")
			oItems:SetProperty("ItemBar",h2,"A",20/*exBarKeepWorkingCount*/,.T.)
			oItems:SetProperty("ItemNonworkingUnits",h2,.F.,"weekday(value) in (1,2)")
			oItems:SetProperty("ItemNonworkingUnits",h2,.T.,"weekday(value) in (1, 2) or (hour(value)<4 or hour(value)>=12 )")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1629
How can I define the default bar's foreground color

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oChart := oG2antt:Chart()
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:SetProperty("PaneWidth",.F.,48)
			oBar := oChart:Bars:Item("Task")
				oBar:Height := 15
				oBar:Pattern := 1/*exPatternSolid*/
				oBar:SetProperty("Def",8/*exBarForeColor*/,16777215)
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/06/2001","K1","bar A")
			oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/06/2001","K2","bar B")
			oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/02/2001","01/06/2001","K3","bar C")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1628
How can I print the selected items only

PROCEDURE OnAddItem(oG2antt,Item)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oPrint
	LOCAL oItems
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/

		oG2antt:BeginUpdate()
		oG2antt:SingleSel := .F.
		oG2antt:ColumnAutoResize := .F.
		oG2antt:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oG2antt:DataSource := rs
		oG2antt:Chart():FirstVisibleDate := "08/04/1994"
		oItems := oG2antt:Items()
			oItems:SetProperty("SelectItem",oItems:ItemByIndex(0),.T.)
			oItems:SetProperty("SelectItem",oItems:ItemByIndex(2),.T.)
			oItems:SetProperty("SelectItem",oItems:ItemByIndex(4),.T.)
		oG2antt:EndUpdate()
		oPrint := CreateObject("Exontrol.Print")
			oPrint:Options := "Print = Selection"
			oPrint:PrintExt := oG2antt
			oPrint:Preview()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1627
How can I sort the columns to be displayed on the columns floating bar
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumns

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:ColumnAutoResize := .F.
		oColumns := oG2antt:Columns()
			oColumns:Add("City"):Visible := .F.
			oColumns:Add("Start"):Visible := .F.
			oColumns:Add("End"):Visible := .F.
		oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
		oG2antt:ColumnsFloatBarSortOrder := 1/*SortAscending*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1626
How can I add a vertical padding for my cells
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DrawGridLines := -1/*exAllLines*/
		oColumn := oG2antt:Columns():Add("Padding")
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
			oColumn:SetProperty("Def",16/*exCellSingleLine*/,.F.)
			oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,6)
			oColumn:SetProperty("Def",49/*exCellPaddingRight*/,6)
			oColumn:SetProperty("Def",50/*exCellPaddingTop*/,6)
			oColumn:SetProperty("Def",51/*exCellPaddingBottom*/,6)
		oItems := oG2antt:Items()
			oItems:AddItem("padding")
			oItems:AddItem("padding")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1625
Trying to fill the second columns. How can I do that
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumns
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oColumns := oG2antt:Columns()
			oColumns:Add("Column 1")
			oColumns:Add("Column 2")
			oColumns:Add("Column 3")
		oItems := oG2antt:Items()
			h := oItems:AddItem("SubItem 1.1")
			oItems:SetProperty("CellValue",h,1,"SubItem 1.2")
			oItems:SetProperty("CellValue",h,2,"SubItem 1.3")
			h := oItems:AddItem("SubItem 2.1")
			oItems:SetProperty("CellValue",h,1,"SubItem 2.2")
			oItems:SetProperty("CellValue",h,2,"SubItem 2.3")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1624
How can I specify a different background color for item, in chart or list panels

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems
	LOCAL h,hC

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:Columns():Add("Default")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Root")
			hC := oItems:InsertItem(h,,"Child 1")
			oItems:SetProperty("ItemBackColor",hC,AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oG2antt:Chart():SetProperty("ItemBackColor",hC,AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
			oItems:InsertItem(h,,"Child 2")
			oItems:SetProperty("ExpandItem",h,.T.)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1623
Is it possible to specify a status part for each bar

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oG2antt:Chart():FirstVisibleDate := "01/01/2001"
		oG2antt:Chart():SetProperty("PaneWidth",.F.,64)
		oG2antt:Debug := .T.
		oG2antt:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAAChABL8IQAAYAQGKIaBwAKBQAGaAoDDQNgyQwAAxwdBMKgBBCLIxhEYobgmGIaRjHcQjEKoSxHEqIRpGCRoJiqLIZAJIEZRZAcaQvGSQYRASCRNDEOA0TDAY4jPD4aQiGIbRjjeL5YjiNo2UxTNRQCEB")
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task 1")
			oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A")
			oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B1")
			oItems:AddBar(h,"Task","01/08/2001","01/17/2001","B2")
			oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K3")
			oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K4")
			oItems:SetProperty("ItemBar",0,"<*>",33/*exBarColor*/,255)
			oItems:SetProperty("ItemBar",0,"<*>",51/*exBarFrameColor*/,16777216)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1622
How can I change the the focus rectangle

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:VisualAppearance():Add(1,"C:\Program Files\Exontrol\ExG2antt\sample\EBN\hoverinsert.ebn")
		oG2antt:SetProperty("Background",19/*exShowFocusRect*/,0x1000000)
		oColumn := oG2antt:Columns():Add("Check")
			oColumn:SetProperty("Def",48/*exCellPaddingLeft*/,2)
			oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
		oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor())
		oG2antt:SetProperty("SelBackColor",oG2antt:BackColor())
		oG2antt:DefaultItemHeight := 22
		oG2antt:ShowFocusRect := .T.
		oItems := oG2antt:Items()
			oItems:AddItem("")
			oItems:AddItem("")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1621
Can each cell have their own dropdown lists that contain "different list item values" for each cell, not predefined for the entire column
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oEditor,oEditor1,oEditor2,oEditor3
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oEditor := oG2antt:Columns():Add("Column/Cell-Same"):Editor()
			oEditor:EditType := 3/*DropDownListType*/
			oEditor:AddItem(0,"Zero")
			oEditor:AddItem(1,"One")
			oEditor:AddItem(2,"Two")
		oEditor1 := oG2antt:Columns():Add("Column/Cell-Different"):Editor()
			oEditor1:EditType := 1/*EditType*/
		oItems := oG2antt:Items()
			oItems:AddItem()
			h := oItems:AddItem(0)
			oEditor2 := oItems:CellEditor(h,1)
				oEditor2:EditType := 3/*DropDownListType*/
				oEditor2:AddItem(3,"Three")
				oEditor2:AddItem(4,"Four")
			oItems:SetProperty("CellValue",h,1,3)
			oItems:AddItem()
			h := oItems:AddItem(0)
			oEditor3 := oItems:CellEditor(h,1)
				oEditor3:EditType := 6/*CheckListType*/
				oEditor3:AddItem(1,"Single")
				oEditor3:AddItem(2,"Double")
			oItems:SetProperty("CellValue",h,1,3)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1620
How can I specify just a few fonts in a FontType editor
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:DefaultItemHeight := 22
		oG2antt:DrawGridLines := -2/*exRowLines*/
		oEditor := oG2antt:Columns():Add("Fonts"):Editor()
			oEditor:EditType := 10/*FontType*/
			oEditor:ClearItems()
			oEditor:AddItem(0,"Calibri")
			oEditor:AddItem(1,"Arial")
			oEditor:AddItem(2,"Rockwell")
			oEditor:AddItem(3,"Tahoma")
			oEditor:SortItems(.T.)
			oEditor:DropDownRows := 4
		oItems := oG2antt:Items()
			oItems:AddItem("Tahoma")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1619
How can I show only the working-hours in chart and histogram panels

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Tasks")
		oG2antt:DrawGridLines := -1/*exAllLines*/
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,40)
			oChart:FirstVisibleDate := "06/20/2005"
			oChart:HistogramVisible := .T.
			oChart:HistogramHeight := 64
			oChart:HistogramView := 112/*exHistogramAllItems*/
			oChart:LevelCount := 3
			oChart:NonworkingHours := 16253183
			oBar := oChart:Bars():Item("Task")
				oBar:HistogramType := 1/*exHistOverAllocation*/
				oBar:HistogramPattern := oBar:Pattern()
			oChart:ShowNonworkingDates := .F.
			oChart:ShowNonworkingUnits := .F.
			oChart:ShowNonworkingHours := .F.
			oChart:DrawGridLines := -1/*exAllLines*/
			oChart:UnitScale := 65536/*exHour*/
			oChart:UnitWidth := 4
			oChart:ResizeUnitScale := oChart:UnitScale()
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task A")
			oItems:AddBar(h,"Task","06/23/2005 11:00:00","06/23/2005 12:00:00")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"0.0416666")
			oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.)
			h := oItems:AddItem("Task B")
			oItems:AddBar(h,"Task","06/23/2005 12:00:00","06/23/2005 16:00:00")
			oItems:SetProperty("ItemBar",h,"",21/*exBarEffort*/,"0.0416666")
			oItems:SetProperty("ItemBar",h,"",20/*exBarKeepWorkingCount*/,.T.)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1618
How do you embed HTML options into the anchor click string
PROCEDURE OnAnchorClick(oG2antt,AnchorID,Options)
	DevOut( Transform(AnchorID,"") )
	DevOut( Transform(Options,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:AnchorClick := {|AnchorID,Options| OnAnchorClick(oG2antt,AnchorID,Options)} /*Occurs when an anchor element is clicked.*/

		oG2antt:BeginUpdate()
		oColumns := oG2antt:Columns()
			oColumns:Add("Car"):SetProperty("Def",17/*exCellValueFormat*/,1)
		oItems := oG2antt:Items()
			oItems:AddItem("<a mazda_1;options for 1>Mazda <b>1</b></a>")
			oItems:AddItem("<a mazda_2;options for 2>Mazda <b>2</b></a>")
			oItems:AddItem("<a mazda_3;options for 3a>Mazda <b>3.a</b></a>")
			oItems:AddItem("<a mazda_3;options for 3b>Mazda <b>3.b</b></a>")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1617
How do I add a checkbox column (method 2)

PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex)
	DevOut( "CheckBox Changed:" )
	DevOut( Transform(oG2antt:Items:CellState(Item,ColIndex),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Check"):SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
		oItems := oG2antt:Items()
			oItems:SetProperty("CellState",oItems:AddItem("Check 1"),0,0)
			oItems:SetProperty("CellState",oItems:AddItem("Check 2"),0,1)
			oItems:SetProperty("CellState",oItems:AddItem("Check 3"),0,0)
			oItems:SetProperty("CellState",oItems:AddItem("Check 4"),0,1)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1616
How do I add a checkbox column (method 1)

PROCEDURE OnChange(oG2antt,Item,ColIndex,NewValue)
	DevOut( "CheckBox Changed:" )
	DevOut( Transform(NewValue,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oEditor
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:Change := {|Item,ColIndex,NewValue| OnChange(oG2antt,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/

		oG2antt:BeginUpdate()
		oColumn := oG2antt:Columns():Add("Check")
			oEditor := oColumn:Editor()
				oEditor:EditType := 19/*CheckValueType*/
				oEditor:SetProperty("Option",17/*exCheckValue2*/,1)
		oItems := oG2antt:Items()
			oItems:AddItem(0)
			oItems:AddItem(1)
			oItems:AddItem(0)
			oItems:AddItem(1)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1615
How do I change the progress bar's appearance

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oAppearance
	LOCAL var_Editor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oAppearance := oG2antt:VisualAppearance()
			oAppearance:Add(1,"c:\exontrol\images\normal.ebn")
			oAppearance:Add(2,"c:\exontrol\images\pushed.ebn")
		var_Editor := oG2antt:Columns:Add("Progress"):Editor()
			var_Editor:EditType := 13/*ProgressBarType*/
			var_Editor:SetProperty("Option",11/*exProgressBarBackColor*/,16777216)
			var_Editor:SetProperty("Option",13/*exProgressBarMarkTicker*/,33554432)
		oG2antt:Items():AddItem(33)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1614
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 3)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:VisualAppearance():Add(1,"gBFLBCJwBAEHhEJAEGg4BVEIQAAYAQGKIYBkAKBQAGaAoDDMOQwQwAAxjGKEEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQCWIAzATGYBRfIUEgjBM6ExwG78egBHp/ZpkACIJJAaRjHQdJxGKKMQB9DIhCZpeKhWgkKIJBzOEyBRC4ERBGqNGrsIgLEqWZpnWhaNpWXYTLyBN64LhuK46g53O6wLxvK6hEr2dJ/YBcIAOfghf4NQ7EMRxLC8Mw3BDvYDkOAABAIgI=")
		oG2antt:SetProperty("SelBackColor",0x1fffffe)
		oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,0 } )  , .F. ))
		oG2antt:SetProperty("SelBackColor",0x1000000)
		oG2antt:ShowFocusRect := .F.
		oG2antt:Columns():Add("Items")
		oG2antt:DefaultItemHeight := 22
		oItems := oG2antt:Items()
			oItems:SetProperty("ItemBackColor",oItems:AddItem("red"),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("blue"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("green"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1613
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:SelBackMode := 1/*exTransparent*/
		oG2antt:DefaultItemHeight := 22
		oG2antt:ShowFocusRect := .F.
		oG2antt:Columns():Add("Items")
		oItems := oG2antt:Items()
			oItems:SetProperty("ItemBackColor",oItems:AddItem("red"),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("blue"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("green"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1612
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:SetProperty("SelBackColor",oG2antt:BackColor())
		oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor())
		oG2antt:DefaultItemHeight := 22
		oG2antt:ShowFocusRect := .T.
		oG2antt:Columns():Add("Items")
		oItems := oG2antt:Items()
			oItems:SetProperty("ItemBackColor",oItems:AddItem("red"),AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("blue"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,0,255 } )  , .F. ))
			oItems:SetProperty("ItemBackColor",oItems:AddItem("green"),AutomationTranslateColor( GraMakeRGBColor  ( { 0,255,0 } )  , .F. ))
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1611
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that

PROCEDURE OnBeforeExpandItem(oG2antt,Item,Cancel)
	DevOut( "BeforeExpandItem" )
	DevOut( Transform(Item,"") )
	oG2antt:Items():InsertItem(Item,,"new child")
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumn
	LOCAL oColumns
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeforeExpandItem := {|Item,Cancel| OnBeforeExpandItem(oG2antt,Item,Cancel)} /*Fired before an item is about to be expanded (collapsed).*/

		oG2antt:BeginUpdate()
		oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/
		oColumns := oG2antt:Columns()
			oColumn := oColumns:Add("Items")
				oColumn:DisplayFilterButton := .T.
				oColumn:FilterList := 4/*exRootItems*/
		oItems := oG2antt:Items()
			oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 1"),.T.)
			oItems:SetProperty("ItemHasChildren",oItems:InsertItem(,,"Group 2"),.T.)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1610
How can identify when I clicked Hour, Month, or Year of the time-scale overview

PROCEDURE OnOverviewZoom(oG2antt)
	DevOut( "UnitScale: " )
	DevOut( Transform(oG2antt:Chart:UnitScale(),"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:OverviewZoom := {|| OnOverviewZoom(oG2antt)} /*Occurs once the user selects a new time scale unit in the overview zoom area.*/

		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,128)
			oChart:LevelCount := 2
			oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/
			oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1609
How can define a minimum and maximum in a column SpinType
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oColumns
	LOCAL oEditor

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oColumns := oG2antt:Columns()
			oEditor := oColumns:Add("SpinType between 5 and 150"):Editor()
				oEditor:EditType := 20/*SliderType*/
				oEditor:Numeric := -1/*exInteger*/
				oEditor:SetProperty("Option",41/*exSliderWidth*/,0)
				oEditor:SetProperty("Option",43/*exSliderMin*/,5)
				oEditor:SetProperty("Option",44/*exSliderMax*/,150)
		oG2antt:Items():AddItem(50)

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1608
How I can change the title of the time-scale overview. (Example: Month by 'Mes', Day by 'Dia')

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,128)
			oChart:LevelCount := 2
			oChart:OverviewVisible := 2/*exOverviewShowAllVisible*/
			oChart:AllowOverviewZoom := 1/*exAlwaysZoom*/
			oChart:OverviewZoomCaption := "Aņo|||Mes|||Dia|||"
			oChart:SetProperty("Label",1/*exHalfYear*/,"")
			oChart:SetProperty("Label",2/*exQuarterYear*/,"")
			oChart:SetProperty("Label",17/*exThirdMonth*/,"")
			oChart:SetProperty("Label",256/*exWeek*/,"")
			oChart:SetProperty("Label",65536/*exHour*/,"")
			oChart:SetProperty("Label",1048576/*exMinute*/,"")
			oChart:SetProperty("Label",16777216/*exSecond*/,"")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1607
Is it possible to set a fixed wide for the Items List Arrea, so that when changing the Form.width, the Items List Arrea be constant and therefor changing the Chart Area-wide
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:OnResizeControl := 1/*exResizeChart*/

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1606
How can I clear the colors for all bars at once
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oG2antt:Chart():FirstVisibleDate := "01/01/2001"
		oG2antt:Chart():SetProperty("PaneWidth",.F.,64)
		oG2antt:Debug := .T.
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task 1")
			oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A")
			oItems:SetProperty("ItemBar",h,"A",33/*exBarColor*/,65280)
			oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B1")
			oItems:AddBar(h,"Task","01/08/2001","01/17/2001","B2")
			oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K3")
			oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K4")
			oItems:SetProperty("ItemBar",0,"<*>",33/*exBarColor*/,0)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1605
How can I change the colors for all bars at once
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oG2antt:Columns():Add("Task")
		oG2antt:Chart():FirstVisibleDate := "01/01/2001"
		oG2antt:Chart():SetProperty("PaneWidth",.F.,64)
		oG2antt:Debug := .T.
		oItems := oG2antt:Items()
			h := oItems:AddItem("Task 1")
			oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A")
			oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B1")
			oItems:AddBar(h,"Task","01/08/2001","01/17/2001","B2")
			oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/02/2001","01/04/2001","K3")
			oItems:AddBar(oItems:AddItem("Task 4"),"Task","01/02/2001","01/04/2001","K4")
			oItems:SetProperty("ItemBar",0,"<*>",33/*exBarColor*/,255)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1604
How can I show my custom bars in the histogram (method 3)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:LevelCount := 2
			oChart:AllowLinkBars := .F.
			oChart:DrawGridLines := -1/*exAllLines*/
			oChart:FirstVisibleDate := "12/31/2000"
			oChart:HistogramVisible := .T.
			oChart:HistogramHeight := 64
			oChart:SetProperty("PaneWidth",.F.,128)
			oBar := oChart:Bars:Item("Task")
				oBar:HistogramType := 256/*exHistCumulative*/
				oBar:HistogramItems := 6
				oBar:HistogramPattern := oBar:Pattern()
				oBar:HistogramCumulativeOriginalColorBars := 1/*exKeepOriginalColor*/
				oBar:OverlaidType := 1/*exOverlaidBarsOffset*/
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
			oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
			h := oItems:AddItem("Item 3")
			oItems:AddBar(h,"Task","01/08/2001","01/12/2001")
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,255)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1603
How can I show my custom bars in the histogram (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oChart
	LOCAL oItems
	LOCAL h

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,64)
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:HistogramVisible := .T.
			oChart:HistogramHeight := 32
			oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
			oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
			h := oItems:AddItem("Item 3")
			oItems:AddBar(h,"Task","01/08/2001","01/12/2001")
			oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,255)
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1602
How can I show my custom bars in the histogram (method 1)
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oBar
	LOCAL oChart
	LOCAL oItems

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:BeginUpdate()
		oChart := oG2antt:Chart()
			oChart:SetProperty("PaneWidth",.F.,64)
			oChart:FirstVisibleDate := "01/01/2001"
			oChart:HistogramVisible := .T.
			oChart:HistogramHeight := 32
			oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/
			oBar := oChart:Bars():CallMethod("Copy","Task","MyBar")
				oBar:HistogramPattern := 5/*exPatternFDiagonal*/
				oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
				oBar:SetProperty("HistogramColor",oBar:Color())
		oG2antt:Columns():Add("Column")
		oItems := oG2antt:Items()
			oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
			oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
			oItems:AddBar(oItems:AddItem("Item 3"),"MyBar","01/08/2001","01/12/2001")
		oG2antt:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1601
Do you have any Fit-To-Page options when printing the control

PROCEDURE OnAddItem(oG2antt,Item)
	LOCAL oItems
	oItems := oG2antt:Items()
		oItems:AddBar(Item,"Task",oItems:CellValue(Item,2),oItems:CellValue(Item,4))
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oG2antt
	LOCAL oPrint
	LOCAL rs

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oG2antt := XbpActiveXControl():new( oForm:drawingArea )
	oG2antt:CLSID  := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
	oG2antt:create(,, {10,60},{610,370} )

		oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/

		oG2antt:BeginUpdate()
		oG2antt:ColumnAutoResize := .F.
		oG2antt:ContinueColumnScroll := .F.
		rs := CreateObject("ADOR.Recordset")
			rs:Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb",3/*adOpenStatic*/,3/*adLockOptimistic*/)
		oG2antt:DataSource := rs
		oG2antt:Chart():FirstVisibleDate := "08/04/1994"
		oG2antt:EndUpdate()
		oPrint := CreateObject("Exontrol.Print")
			oPrint:Options := "FitToPage = On"
			oPrint:PrintExt := oG2antt
			oPrint:Preview()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN